This repository was archived by the owner on Jun 15, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -6,8 +6,11 @@ import path from 'node:path'
66import { exec as ecp , spawn } from 'node:child_process'
77import os from 'node:os'
88
9- const exec = util . promisify ( ecp )
109const __dirname = path . dirname ( import . meta. url ) . replace ( `file://${ os . platform ( ) === 'win32' ? '/' : '' } ` , '' )
10+
11+ const csaVersion = JSON . parse ( await fs . readFile ( path . join ( __dirname , './package.json' ) ) ) . version
12+
13+ const exec = util . promisify ( ecp )
1114const DEFAULT_TEMPLATE = 'vanilla'
1215
1316async function copyFileOrFolder ( source , target ) {
@@ -36,6 +39,7 @@ const cp = async (a, b) => copyFileOrFolder(
3639)
3740
3841async function help ( templateNames ) {
42+ console . log ( `create-socket-app v${ csaVersion } ` )
3943 console . log ( `usage: npm create socket-app [${ templateNames . join ( ' | ' ) } ]` )
4044}
4145
@@ -79,7 +83,7 @@ async function main (argv) {
7983
8084 const templateNames = await fs . readdir ( path . join ( __dirname , 'templates' ) )
8185
82- if ( argv . find ( s => s . includes ( '-h' ) ) ) {
86+ if ( argv . find ( s => s . includes ( '-h' ) ) || argv . find ( s => s . includes ( '--help' ) ) || argv . find ( s => s . includes ( '-v' ) ) || argv . find ( s => s . includes ( '--version' ) ) ) {
8387 return help ( templateNames )
8488 }
8589
You can’t perform that action at this time.
0 commit comments