For example this allows running all tests with the more convenient form:
% conkeror -q -batch -l tests/simple
The new load_js function (split from load_rc) loads files with a .js
extension in the directory.
Note: the command line path resolver returns an nsIFile, which doesn't
provide an appendRelativePath method. The change to use the append
method works for both nsIFile and nsILocalFile.
---
modules/command-line.js | 2 +-
modules/rc.js | 6 +++++-
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/modules/command-line.js b/modules/command-line.js
index 10e4a5d..3b861d3 100644
--- a/modules/command-line.js
+++ b/modules/command-line.js
@@ -112,7 +112,7 @@ command_line_param_handler("f", true, function (command,
ctx) {
command_line_param_handler("l", false, function (path, ctx) {
try {
- load(ctx.command_line.resolveFile(path));
+ load_js(ctx.command_line.resolveFile(path));
} catch (e) {
dump_error(e);
}
diff --git a/modules/rc.js b/modules/rc.js
index 780d6ed..4f60b1b 100644
--- a/modules/rc.js
+++ b/modules/rc.js
@@ -30,6 +30,10 @@ function load_rc () {
//FIXME: else log that the rc does not exist
return;
}
+ return load_js(path);
+}
+
+function load_js (path) {
var files = [];
var ret;
if (path.isDirectory()) {
@@ -48,7 +52,7 @@ function load_rc () {
else
return 0;
});
- path.appendRelativePath("a");
+ path.append("a");
ret = path.path.substr(0, path.path.length - 1) + "*.js";
} else {
files.push(path);
--
1.7.6.3
_______________________________________________
Conkeror mailing list
[email protected]
https://www.mozdev.org/mailman/listinfo/conkeror