Skip to content

Commit

Permalink
install.js: use async/await instead of a Promise (#158)
Browse files Browse the repository at this point in the history
  • Loading branch information
XhmikosR authored Sep 7, 2024
1 parent b2ad859 commit 1723b6c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
12 changes: 6 additions & 6 deletions lib/install.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ async function main() {

const bin = await hugoBin(projectRoot);

bin.run(['version']).then(() => {
try {
await bin.run(['version']);
console.log('Hugo binary successfully installed!');
})
.catch(error => {
console.error('Hugo binary installation failed!');
throw new Error(error);
});
} catch (error) {
console.error('Hugo binary installation failed!');
throw new Error(error);
}
}

main();
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@
"error",
"always"
],
"promise/prefer-await-to-then": "off",
"space-before-function-paren": [
"error",
"never"
Expand Down

0 comments on commit 1723b6c

Please sign in to comment.