projects
/
project
/
luci.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
libs/uvl: convert uvlc to nixio.fs api, fix error condition when no schema is found
[project/luci.git]
/
libs
/
uvl
/
root
/
usr
/
bin
/
uvlc
diff --git
a/libs/uvl/root/usr/bin/uvlc
b/libs/uvl/root/usr/bin/uvlc
index
c07cc54
..
caaeb2a
100755
(executable)
--- a/
libs/uvl/root/usr/bin/uvlc
+++ b/
libs/uvl/root/usr/bin/uvlc
@@
-1,21
+1,22
@@
#!/usr/bin/lua
#!/usr/bin/lua
-
if arg[1] then
require("luci.util")
require("luci.uvl")
if arg[1] then
require("luci.util")
require("luci.uvl")
- require("
luci
.fs")
+ require("
nixio
.fs")
local uvl = luci.uvl.UVL()
local scheme, err = uvl:get_scheme( arg[1] )
if scheme then
local uvl = luci.uvl.UVL()
local scheme, err = uvl:get_scheme( arg[1] )
if scheme then
-
luci
.fs.writefile(
+
nixio
.fs.writefile(
"%s/bytecode/%s.lua" %{ uvl.schemedir, arg[1] },
luci.util.get_bytecode(scheme)
)
"%s/bytecode/%s.lua" %{ uvl.schemedir, arg[1] },
luci.util.get_bytecode(scheme)
)
- else
+ else
if err then
print("Error:", err:string())
print("Error:", err:string())
+ else
+ print("Error: Can not find scheme:", arg[1])
end
else
print( "Usage: uvlc <scheme>" )
end
else
print( "Usage: uvlc <scheme>" )