1.7.10 compatibility
This commit is contained in:
@@ -67,7 +67,7 @@ local RECIPES_FILE = 'usr/config/recipes.db'
|
||||
|
||||
local craftingPaused = false
|
||||
local canCraft = not not (turtle and turtle.craft)
|
||||
local canLearn = not not duckAntenna or not not turtleChestAdapter
|
||||
local canLearn = not not (canCraft and (duckAntenna or turtleChestAdapter))
|
||||
local userRecipes = Util.readTable(RECIPES_FILE) or { }
|
||||
local jobList
|
||||
local resources
|
||||
|
||||
@@ -4,12 +4,19 @@ _G.requireInjector(_ENV)
|
||||
|
||||
local Util = require('util')
|
||||
|
||||
local fs = _G.fs
|
||||
local shell = _ENV.shell
|
||||
|
||||
local args = { ... }
|
||||
local fileName = args[1] or error('Syntax: persist <file name>')
|
||||
local fileName = args[1] and
|
||||
shell.resolve(args[1]) or
|
||||
error('Syntax: persist <file name>')
|
||||
|
||||
local c = Util.readFile(shell.resolve(fileName)) or error('Unable to open file')
|
||||
Util.writeFile(shell.resolve(fileName), c)
|
||||
local c = Util.readFile() or error('Unable to read file')
|
||||
|
||||
-- ensure it is writable - if not an error is thrown
|
||||
Util.writeFile(fileName, '')
|
||||
fs.delete(fileName)
|
||||
Util.writeFile(fileName, c)
|
||||
|
||||
print('Saved')
|
||||
|
||||
Reference in New Issue
Block a user