minecraft-cc-tools/install.lua
2024-05-19 13:15:54 +02:00

33 lines
684 B
Lua

local LIST_FILES = {
'miner.lua',
'libs/turtle-utils.lua',
'libs/robot.lua'
};
local LIST_CONFIG_FILES = {
'startup.lua',
'config/config-miner.lua'
}
local REPO_PREFIX = 'https://git.trapcloud.fr/guillaumearm/minecraft-cc-tools/raw/branch/master/'
local previousDir = shell.dir()
fs.makeDir('/libs')
fs.makeDir('/config')
for _, filePath in pairs(LIST_FILES) do
fs.delete(filePath)
shell.execute('wget', REPO_PREFIX .. filePath, filePath)
end
-- do not override existing config files
for _, filePath in pairs(LIST_CONFIG_FILES) do
if not fs.exists(filePath) then
shell.execute('wget', REPO_PREFIX .. filePath, filePath)
end
end
shell.setDir(previousDir)