Skip to content

Commit

Permalink
Forced exit when finished. Seems npx doesn't cleanly exit otherwise.
Browse files Browse the repository at this point in the history
  • Loading branch information
neonexus committed Nov 5, 2023
1 parent 7734d3c commit db04e6a
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 28 deletions.
48 changes: 24 additions & 24 deletions package-lock.json

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

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "drfg",
"version": "0.0.3",
"version": "0.0.4",
"description": "Download Release From GitHub, extract it into a new directory, and install dependencies, with a single command.",
"bin": {
"drfg": "src/bin.js",
Expand Down Expand Up @@ -55,8 +55,8 @@
},
"devDependencies": {
"chai": "4.3.10",
"chai-spies": "1.0.0",
"eslint": "8.52.0",
"chai-spies": "1.1.0",
"eslint": "8.53.0",
"mocha": "10.2.0"
}
}
2 changes: 2 additions & 0 deletions src/bin.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ function getOnWithIt() {
, true // isSmall
);
blankLine();

process.exit(0); // force a clean exit
}).catch((e) => {
console.error(e);
});
Expand Down
2 changes: 1 addition & 1 deletion src/utilities.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const utils = {
if (bytes === 0) return '0 Bytes';

const sizes = ['Bytes', 'KiB', 'MiB', 'GiB', 'TiB'];
const i = parseInt(Math.floor(Math.log(bytes) / Math.log(1024)));
const i = Math.floor(Math.log(bytes) / Math.log(1024));
const finalNumber = bytes / Math.pow(1024, i);

return ((i > 0) ? finalNumber.toFixed(2) : finalNumber) + ' ' + sizes[i];
Expand Down

0 comments on commit db04e6a

Please sign in to comment.