Skip to content

Commit fca1f3b

Browse files
committed
add version to cli
1 parent b8fbbaf commit fca1f3b

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/BareServer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ const pkg = JSON.parse(
2828
readFileSync(join(__dirname, '..', 'package.json'), 'utf-8')
2929
) as { version: string };
3030

31-
const project: BareProject = {
31+
export const project: BareProject = {
3232
name: 'bare-server-node',
3333
description: 'TOMPHTTP NodeJS Bare Server',
3434
repository: 'https://github.com/tomphttp/bare-server-node',

src/cli.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import './sourceMap.js';
2+
import { project } from './BareServer.js';
23
import createBareServer from './createServer.js';
34
import { Command } from 'commander';
45
import { config } from 'dotenv';
@@ -10,6 +11,7 @@ const program = new Command();
1011

1112
program
1213
.alias('server')
14+
.version(project.version)
1315
.option('-d, --directory <directory>', 'Bare directory', '/')
1416
.option('-h, --host <host>', 'Listening host', process.env.HOST || '0.0.0.0')
1517
.option<number>(

0 commit comments

Comments
 (0)