Skip to content

Commit 9967a61

Browse files
committed
allow multiple input folders
1 parent 0f61c5f commit 9967a61

File tree

2 files changed

+15
-11
lines changed

2 files changed

+15
-11
lines changed

packages/cli/src/file_operations.ts

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,22 @@ export class FileOperations {
2020
let skipped = 0;
2121
let added = 0;
2222

23-
for (const filename of glob.sync(config.input_folder + "/**", {nosort: true, nodir: true})) {
24-
if (filter.length > 0 && filter.some(a => a.test(filename)) === false) {
25-
skipped++;
26-
continue;
23+
const folders = Array.isArray(config.input_folder) ? config.input_folder : [config.input_folder];
24+
for (const folder of folders) {
25+
for (const filename of glob.sync(folder + "/**", {nosort: true, nodir: true})) {
26+
if (filter.length > 0 && filter.some(a => a.test(filename)) === false) {
27+
skipped++;
28+
continue;
29+
}
30+
files.push({
31+
filename: path.basename(filename),
32+
relative: path.relative(config.output_folder, path.dirname(filename)),
33+
contents: fs.readFileSync(filename, "utf8"),
34+
});
35+
added++;
2736
}
28-
files.push({
29-
filename: path.basename(filename),
30-
relative: path.relative(config.output_folder, path.dirname(filename)),
31-
contents: fs.readFileSync(filename, "utf8"),
32-
});
33-
added++;
3437
}
38+
3539
console.log(added + " files added from source");
3640
console.log(skipped + " files skipped in source");
3741
return files;

packages/cli/src/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import {ITranspilerOptions} from "@abaplint/transpiler";
22

33
export interface ITranspilerConfig {
4-
input_folder: string;
4+
input_folder: string | string[];
55
/** list of regex, case insensitive, empty gives all files, positive list */
66
input_filter?: string[];
77
output_folder: string;

0 commit comments

Comments
 (0)