Skip to content

Commit

Permalink
catch error
Browse files Browse the repository at this point in the history
  • Loading branch information
kruplm committed Feb 28, 2023
1 parent 93d742e commit 41661b0
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
3 changes: 2 additions & 1 deletion Tryouts/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
node_modules/
.angular/
dist/
dist/
.vscode/
9 changes: 7 additions & 2 deletions Tryouts/Prototypes/Shell/Node-launcher/Lib/src/cli/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,10 @@

import { executeScriptFile } from './executeScrtiptFile.js';

let fileName = process.argv.slice(2)[0];
executeScriptFile(fileName);
let fileName = process.argv[2];

try {
executeScriptFile(fileName);
} catch (error) {
console.error(error);
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import { execFile, fork } from 'child_process';
import { fork } from 'child_process';
import { resolve } from 'path';

"use strict";

export function executeScriptFile(fileName: string){
console.log("executeScriptFile", fileName);
if (fileName) {
let filePath: string = resolve(fileName);
const child = fork(filePath);
Expand Down

0 comments on commit 41661b0

Please sign in to comment.