From d9945d98e6260e16fb6f781a6d26679246a2a31b Mon Sep 17 00:00:00 2001 From: "tangmengyu.amber" Date: Thu, 8 Sep 2022 11:22:16 +0800 Subject: [PATCH] feat: support display version --- src/index.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/index.ts b/src/index.ts index 26d3fd9..6b4860d 100644 --- a/src/index.ts +++ b/src/index.ts @@ -10,6 +10,7 @@ import inquirer from 'inquirer' import inquirerFileTreeSelection from 'inquirer-file-tree-selection-prompt' import jsonc from 'jsonc-parser' import { execaCommand } from 'execa' +import packageJSON from '../package.json' assert { type: 'json' } inquirer.registerPrompt('file-tree-selection', inquirerFileTreeSelection) @@ -260,11 +261,13 @@ async function selectFile( try { console.log( `\n${chalk.bold.blue(` -_____ _____ ____ _ + _____ _____ ____ _ |_ _|__ ___| ____|_ __ _ __| _ \\(_)_ __ ___ | |/ __|/ __| _| | '__| '__| | | | | '__/ __| | |\\__ \\ (__| |___| | | | | |_| | | | \\__ \\ - |_||___/\\___|_____|_| |_| |____/|_|_| |___/ + |_||___/\\___|_____|_| |_| |____/|_|_| |___/ ${chalk.cyanBright( + `[version: v${packageJSON.version}]` + )} `)}` ) const parsedEnvArgs = cli.parse()