Commit 482a96ba authored by rswindell's avatar rswindell
Browse files

Use full path for read/write .cnf files so that the cwd doesn't matter (in

theory at least) and "jsexec -C" could be used to execute this script. Maybe.
parent ee9a175d
...@@ -227,9 +227,9 @@ function install(ini_fname) ...@@ -227,9 +227,9 @@ function install(ini_fname)
print("Sub-categories: " + subs.join(", ")); print("Sub-categories: " + subs.join(", "));
var cnflib = load({}, "cnflib.js"); var cnflib = load({}, "cnflib.js");
var xtrn_cnf = cnflib.read("xtrn.cnf"); var xtrn_cnf = cnflib.read(system.ctrl_dir + "xtrn.cnf");
if (!xtrn_cnf) if (!xtrn_cnf)
return "Failed to read xtrn.cnf"; return "Failed to read " + system.ctrl_dir + "xtrn.cnf";
var startup_dir = ini_fname.substr(0, Math.max(ini_fname.lastIndexOf("/"), ini_fname.lastIndexOf("\\"), 0)); var startup_dir = ini_fname.substr(0, Math.max(ini_fname.lastIndexOf("/"), ini_fname.lastIndexOf("\\"), 0));
...@@ -374,8 +374,8 @@ function install(ini_fname) ...@@ -374,8 +374,8 @@ function install(ini_fname)
} }
if (installed) { if (installed) {
if (!options.debug && !cnflib.write("xtrn.cnf", undefined, xtrn_cnf)) if (!options.debug && !cnflib.write(system.ctrl_dir + "xtrn.cnf", undefined, xtrn_cnf))
return "Failed to write xtrn.cnf"; return "Failed to write " + system.ctrl_dir + "xtrn.cnf";
print("Installed " + installed + " items from " + ini_fname + " successfully"); print("Installed " + installed + " items from " + ini_fname + " successfully");
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment