Skip to content

Commit

Permalink
v0.1.1: Fix --version not printing version
Browse files Browse the repository at this point in the history
  • Loading branch information
hieplpvip committed Jan 5, 2024
1 parent d078a50 commit de27118
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 9 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# scratch-run changelog

### v0.1.1

- Fix `--version` not printing version

### v0.1.0

- Add argument `--buffer-stdout`
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "scratch-run",
"version": "0.1.0",
"version": "0.1.1",
"description": "Run Scratch from command line",
"main": "./index.js",
"scripts": {
Expand Down
12 changes: 6 additions & 6 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ const argv = require('minimist')(process.argv.slice(2), {
boolean: ['help', 'version', 'check', 'buffer-stdout']
});

if (argv.version) {
const { version } = require('../package.json');
writeStdoutSync(version + '\n');
process.exit(0);
}

if (argv._.length == 0 || argv.help) {
writeStdoutSync(`Usage: scratch-run project-file [OPTIONS]
Options:
Expand All @@ -26,12 +32,6 @@ Options:
process.exit(0);
}

if (argv.version) {
const { version } = require('../package.json');
writeStdoutSync(version + '\n');
process.exit(0);
}

const scratchVM = require('scratch-vm');
const Kattio = require('./kattio');

Expand Down

0 comments on commit de27118

Please sign in to comment.