Skip to content

Commit

Permalink
Add version option
Browse files Browse the repository at this point in the history
  • Loading branch information
Gnuk committed Dec 19, 2024
1 parent 299d4e5 commit 2064eed
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
/dist
/node_modules
/test/cli/tmp
/src/bin/package.json
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.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@tikui/cli",
"version": "2.4.3",
"version": "2.5.0",
"description": "Command lines tool for Tikui",
"main": "index.js",
"files": [
Expand All @@ -14,7 +14,7 @@
"format": "prettier . --check",
"format:fix": "prettier . --write",
"clean": "rimraf dist",
"build": "npm run clean && tsc && cp -r src/cli/generate-project dist/cli/generate-project",
"build": "npm run clean && cp ./package.json src/bin/package.json && tsc && cp -r src/cli/generate-project dist/cli/generate-project",
"test": "jest",
"test:watch": "jest --watch",
"test:watchAll": "jest --watchAll",
Expand Down
4 changes: 4 additions & 0 deletions src/bin/tikuicli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import { program } from 'commander';
import { createComponent } from '@/cli/create-component';
import * as path from 'path';
import { generateProject } from '@/cli/generate-project';
import * as process from 'node:process';
import { version } from './package.json';

try {
program
Expand All @@ -26,6 +28,8 @@ try {
console.log(`Generating project ${project} to ${path.resolve(destination)}`); // eslint-disable-line no-console
});

program.version(version, '-v, --version', 'current version');

program.parse(process.argv);
} catch (e) {
console.error(e.message); // eslint-disable-line no-console
Expand Down
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"emitDecoratorMetadata": true,
"moduleResolution": "node",
"outDir": "dist",
"resolveJsonModule": true,
"paths": {
"@/*": ["src/*"]
},
Expand Down

0 comments on commit 2064eed

Please sign in to comment.