Skip to content
Snippets Groups Projects
Commit b18c66fa authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Add -dir=<code> option to manually specify multiple directories

As requested by Nelgin.

And this option is mutually exclusive with the [dir-code] parameter.
parent 5f89c517
No related branches found
No related tags found
No related merge requests found
......@@ -52,6 +52,7 @@ for(var i = 0; i < argc; i++) {
writeln(" -all add files in all libraries/directories (implies -auto)");
writeln(" -lib=<name> add files in all directories of specified library (implies -auto)");
writeln(" -auto add files only to directories that have Auto-ADDFILES enabled");
writeln(" -dir=<code> add files in directory (can be specified multiple times)");
writeln(" -from=<name> specify uploader's user name (may require quotes)");
writeln(" -file=<name> specify files to add (wildcards supported, default: *)");
writeln(" -ex=<filename> add to excluded filename list");
......@@ -87,6 +88,10 @@ for(var i = 0; i < argc; i++) {
options.auto = true;
continue;
}
if(opt.indexOf("dir=") == 0) {
dir_list.push(opt.slice(4));
continue;
}
if(opt.indexOf("file=") == 0) {
include = opt.slice(5);
continue;
......@@ -153,7 +158,7 @@ var updated = 0;
var renamed = 0;
var missing = [];
for(var d = 0; d < dir_list.length; d++) {
var code = dir_list[d];
var dir = file_area.dir[code];
if(!dir) {
......@@ -163,7 +168,7 @@ for(var d = 0; d < dir_list.length; d++) {
if(options.auto && (dir.settings & DIR_NOAUTO))
continue;
writeln("Adding files to " + dir.lib_name + " " + dir.name);
var filebase = new FileBase(code);
if(!filebase.open("r")) {
alert("Failed to open: " + filebase.file);
......@@ -208,7 +213,6 @@ for(var d = 0; d < dir_list.length; d++) {
}
file_list = file_list.filter(function(obj) { return wildmatch(obj.name, include); });
for(var i = 0; i < file_list.length; i++) {
var file = file_list[i];
file.from = uploader;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment