Skip to content

Commit eb3233f

Browse files
authored
Merge pull request #7 from moberghammer/add-version-option
Added version option
2 parents fac75e5 + 4e297e6 commit eb3233f

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"name": "gitlab-ci-local",
33
"main": "index.js",
4+
"version": "3.0.1",
45
"scripts": {
56
"build-linux": "pkg dist/index.js -t node12-linux-x64 -o ./bin/linux/gitlab-ci-local && gzip -c bin/linux/gitlab-ci-local > bin/linux.gz",
67
"build-macos": "pkg dist/index.js -t node12-macos-x64 -o ./bin/macos/gitlab-ci-local && gzip -c bin/macos/gitlab-ci-local > bin/macos.gz",

src/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ Array.prototype.first = function() {
2222

2323
const argv = yargs.argv;
2424
const cwd = String(argv.cwd || process.cwd());
25+
yargs.alias("v", "version");
26+
yargs.version(JSON.parse(fs.readFileSync(`${cwd}/package.json`, "UTF8")).version);
2527
const m: any = argv.m;
2628
const manualArgs: string[] = [].concat(m || []);
2729

0 commit comments

Comments
 (0)