diff --git a/package.json b/package.json index a8690d773..038b80c8b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,7 @@ { "name": "gitlab-ci-local", "main": "index.js", + "version": "3.0.1", "scripts": { "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", "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", diff --git a/src/index.ts b/src/index.ts index 94b6dbf40..7b9cf0d68 100644 --- a/src/index.ts +++ b/src/index.ts @@ -22,6 +22,8 @@ Array.prototype.first = function() { const argv = yargs.argv; const cwd = String(argv.cwd || process.cwd()); +yargs.alias("v", "version"); +yargs.version(JSON.parse(fs.readFileSync(`${cwd}/package.json`, "UTF8")).version); const m: any = argv.m; const manualArgs: string[] = [].concat(m || []);