diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2009-07-23 03:23:48 +0000 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2009-07-23 03:23:48 +0000 |
commit | 281c92b1d6fa2065baa7c9e5f5cec926a2ea68e6 (patch) | |
tree | 2f60af6f92707940ef8bd08f647c5d41c59a7e09 /libs | |
parent | 60aaab2ede82e0099cd6b3c4dae6b1357cc86234 (diff) |
libs/uvl: convert uvlc to nixio.fs api, fix error condition when no schema is found
Diffstat (limited to 'libs')
-rwxr-xr-x | libs/uvl/root/usr/bin/uvlc | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/libs/uvl/root/usr/bin/uvlc b/libs/uvl/root/usr/bin/uvlc index c07cc54cc..caaeb2af6 100755 --- a/libs/uvl/root/usr/bin/uvlc +++ b/libs/uvl/root/usr/bin/uvlc @@ -1,21 +1,22 @@ #!/usr/bin/lua - 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 - luci.fs.writefile( + nixio.fs.writefile( "%s/bytecode/%s.lua" %{ uvl.schemedir, arg[1] }, luci.util.get_bytecode(scheme) ) - else + elseif err then print("Error:", err:string()) + else + print("Error: Can not find scheme:", arg[1]) end else print( "Usage: uvlc <scheme>" ) |