persist utility
This commit is contained in:
15
apps/persist.lua
Normal file
15
apps/persist.lua
Normal file
@@ -0,0 +1,15 @@
|
||||
-- saves a virtual file to disk
|
||||
|
||||
_G.requireInjector(_ENV)
|
||||
|
||||
local Util = require('util')
|
||||
|
||||
local shell = _ENV.shell
|
||||
|
||||
local args = { ... }
|
||||
local fileName = 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)
|
||||
|
||||
print('Saved')
|
||||
Reference in New Issue
Block a user