diff --git a/src/cli/setup.ts b/src/cli/setup.ts index e843a10..7e9be8e 100644 --- a/src/cli/setup.ts +++ b/src/cli/setup.ts @@ -3,6 +3,7 @@ import { program } from 'commander' import color from 'kleur' import pkg from '../../package.json' +import { SHA } from './version' import { cronList, cronLog, @@ -29,7 +30,7 @@ import { program .name('toes') - .version(`v${pkg.version}`, '-v, --version') + .version(`v${pkg.version}-${SHA}`, '-v, --version') .addHelpText('beforeAll', (ctx) => { if (ctx.command === program) { return color.bold().cyan('🐾 Toes') + color.gray(' - personal web appliance\n') diff --git a/src/cli/version.ts b/src/cli/version.ts new file mode 100644 index 0000000..b2a17ae --- /dev/null +++ b/src/cli/version.ts @@ -0,0 +1,3 @@ +const result = Bun.spawnSync(['git', 'rev-parse', '--short', 'HEAD']) + +export const SHA = result.stdout.toString().trim()