Skip to content

Commit

Permalink
style: leverage one more arrow function
Browse files Browse the repository at this point in the history
  • Loading branch information
NoriSte committed Oct 18, 2019
1 parent 715bd64 commit 780068b
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
1 change: 1 addition & 0 deletions echo.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
console.log(JSON.stringify(process.env, null, 2));
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"install-on-your-machine": "npm pack && sudo npm i -g $(find . -name 'nprr-*.tgz') && sudo -k && rm $(find . -name 'nprr-*.tgz')",
"// TESTS ////////////////////////////": "",
"test": "npm run unit:test && npm run test:import-nprr",
"test:import-nprr": "npm pack && cd test-projects/import-nprr && npm i $(find ../../ -name 'nprr-*') && npm run script && cd ../..",
"test:import-nprr": "npm pack && cd test-projects/import-nprr && npm i $(find ../../ -name 'nprr-*.tgz') && npm run script && cd ../..",
"test:trap": "jest -t 'Trap succeed'",
"stryker": "npx stryker run"
},
Expand Down
15 changes: 8 additions & 7 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,14 @@ const main = argv => {
const { scriptName, options } = parseCmd(argv);
return readNpmScripts()
.then(scripts => autocomplete({ choices: scripts, filter: scriptName }))
.then(answer => {
return new Promise(resolve => {
const params = [answer, ...options];
npm.run(params);
resolve(params);
});
});
.then(
answer =>
new Promise(resolve => {
const params = [answer, ...options];
npm.run(params);
resolve(params);
})
);
};

module.exports = main;
2 changes: 1 addition & 1 deletion test-projects/import-nprr/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 780068b

Please sign in to comment.