File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -65,10 +65,17 @@ async function setProjectName(templateName, projectName) {
6565 await replaceLineInFile ( "bsconfig.json" , `"name": "${ templateName } "` , `"name": "${ projectName } "` ) ;
6666}
6767
68+ function getVersion ( ) {
69+ const packageJsonPath = path . join ( __dirname , "package.json" ) ;
70+ const contents = fs . readFileSync ( packageJsonPath , "utf8" ) ;
71+ return JSON . parse ( contents ) . version ;
72+ }
73+
6874async function main ( ) {
6975 console . clear ( ) ;
7076
71- p . intro ( `${ c . bgCyan ( c . black ( " create-rescript-app " ) ) } ` ) ;
77+ const version = getVersion ( ) ;
78+ p . intro ( `${ c . bgCyan ( c . black ( ` create-rescript-app ` ) ) } ${ c . dim ( version ) } ` ) ;
7279
7380 const projectName = await p . text ( {
7481 message : "What is the name of your new ReScript project?" ,
You can’t perform that action at this time.
0 commit comments