UNPKG

939 BJavaScriptView Raw
1#! /usr/local/bin/node
2"use strict";
3Object.defineProperty(exports, "__esModule", { value: true });
4var fs = require("fs");
5var ApexFile_1 = require("./ApexFile");
6var mode = null;
7var pathString = process.argv[2];
8var processedFiles = new Array();
9if (process.argv.length < 3) {
10 console.error("❗️ Should specify which file or folder to run.");
11 process.exit();
12}
13if (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}
20else {
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}
25processedFiles.forEach(function (file) {
26 file.printReport();
27});