Skip to content

Commit 23b1192

Browse files
committed
feat: update lfs core to latet
1 parent ffccfa4 commit 23b1192

File tree

4 files changed

+30
-9
lines changed

4 files changed

+30
-9
lines changed

.vscode/launch.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,15 @@
44
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
55
"version": "0.2.0",
66
"configurations": [
7+
{
8+
"command": "npm start -- flow:scan -d /Users/jun/Development/github/lightning-flow-scanner-example-flows --config /Users/jun/Development/github/lightning-flow-scanner-example-flows/.flow-scanner.yml",
9+
"name": "Run npm start",
10+
"request": "launch",
11+
"type": "node-terminal",
12+
"env": {
13+
"IS_NEW_SCAN_ENABLED": "false"
14+
}
15+
},
716
{
817
"name": "Launch via NPM",
918
"request": "launch",

package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"cosmiconfig": "^9.0.0",
1111
"fs-extra": "^11.3.0",
1212
"glob": "^11.0.2",
13-
"lightning-flow-scanner-core": "4.40.0"
13+
"lightning-flow-scanner-core": "4.41.0"
1414
},
1515
"devDependencies": {
1616
"@oclif/plugin-help": "6.2.28",
@@ -66,6 +66,8 @@
6666
},
6767
"repository": "https://github.com/Lightning-Flow-Scanner/lightning-flow-scanner-sfdx.git",
6868
"scripts": {
69+
"prestart": "npm run prepack",
70+
"start": "ts-node bin/run",
6971
"lint": "eslint",
7072
"postpack": "rm -f oclif.manifest.json",
7173
"prepack": "rm -rf lib && tsc -b && oclif manifest && oclif readme",

src/commands/flow/scan.ts

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import pkg, {
1313
RuleResult,
1414
ResultDetails,
1515
} from "lightning-flow-scanner-core";
16+
import { inspect } from "util";
1617
const { parse: parseFlows, scan: scanFlows } = pkg;
1718

1819
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
@@ -100,11 +101,20 @@ export default class Scan extends SfCommand<Output> {
100101
const parsedFlows: ParsedFlow[] = await parseFlows(flowFiles);
101102
this.debug(`parsed flows ${parsedFlows.length}`, ...parsedFlows);
102103

103-
const scanResults: ScanResult[] =
104-
this.userConfig && Object.keys(this.userConfig).length > 0
105-
? scanFlows(parsedFlows, this.userConfig)
106-
: scanFlows(parsedFlows);
104+
const tryScan = (): [ScanResult[], error: Error] => {
105+
try {
106+
const scanResult =
107+
this.userConfig && Object.keys(this.userConfig).length > 0
108+
? scanFlows(parsedFlows, this.userConfig)
109+
: scanFlows(parsedFlows);
110+
return [scanResult, null];
111+
} catch (error) {
112+
return [null, error];
113+
}
114+
};
107115

116+
const [scanResults, error] = tryScan();
117+
this.debug(`error:`, inspect(error));
108118
this.debug(`scan results: ${scanResults.length}`, ...scanResults);
109119
this.spinner.stop(`Scan complete`);
110120

0 commit comments

Comments
 (0)