Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
victor871129 committed May 24, 2022
1 parent 783a292 commit 605073e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mainApp.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,8 @@ const firstApp = () => {
const rawData = fileSystem.readFileSync(nodePath.join(process.cwd(), 'package.json'));
const parsedData = JSON.parse(rawData);
const scriptNames = Object.getOwnPropertyNames(parsedData.scripts)
if(argumentRun.some(runArgument => !scriptNames.includes(runArgument))){
return console.error('A name in --run parameters is not found in the scripts.');
if(argumentRun.some(runArgument => !(/^[\w-.]+$/.test(runArgument)) || !scriptNames.includes(runArgument))){
return console.error('A name in --run parameters is not found in the scripts or invalid.');
}
console.log(`0%`);

Expand Down

0 comments on commit 605073e

Please sign in to comment.