1 | #! /usr/local/bin/node
|
2 | "use strict";
|
3 | Object.defineProperty(exports, "__esModule", { value: true });
|
4 | var fs = require("fs");
|
5 | var ApexFile_1 = require("./ApexFile");
|
6 | var mode = null;
|
7 | var pathString = process.argv[2];
|
8 | var processedFiles = new Array();
|
9 | if (process.argv.length < 3) {
|
10 | console.error("❗️ Should specify which file or folder to run.");
|
11 | process.exit();
|
12 | }
|
13 | if (fs.lstatSync(pathString).isDirectory()) {
|
14 | console.log("📂 - Running on folder " + process.argv[2] + "...");
|
15 | fs.readdirSync(pathString).forEach(function (file) {
|
16 | var classFile = new ApexFile_1.ApexFile(file, pathString + '/' + file);
|
17 | processedFiles.push(classFile);
|
18 | });
|
19 | }
|
20 | else {
|
21 | console.log("📄 - Running on file " + process.argv[2] + "...");
|
22 | var apexfile = new ApexFile_1.ApexFile(process.argv[2], pathString);
|
23 | processedFiles.push(apexfile);
|
24 | }
|
25 | processedFiles.forEach(function (file) {
|
26 | file.printReport();
|
27 | });
|