From: Jo-Philipp Wich Date: Thu, 23 Jul 2009 03:23:48 +0000 (+0000) Subject: libs/uvl: convert uvlc to nixio.fs api, fix error condition when no schema is found X-Git-Tag: 0.10.0~1321 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=281c92b1d6fa2065baa7c9e5f5cec926a2ea68e6;p=oweals%2Fluci.git libs/uvl: convert uvlc to nixio.fs api, fix error condition when no schema is found --- 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 " )