File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed
Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ async function create(type, params) {
2828 await installDependencies ( path ) ;
2929 await maybeExecuteInitScript ( path ) ;
3030 updateAddonPlaceholder ( path , type , params ) ;
31+ console . log ( `${ chalk . green . bold ( "addon created successfully" ) } ` ) ;
3132}
3233
3334function validateValues ( type , params ) {
@@ -94,6 +95,7 @@ async function cloneTemplate(type, params) {
9495}
9596
9697function updateAddonPlaceholder ( addonPath , type , params ) {
98+ console . log ( `${ chalk . white . bold ( "updating addon config ..." ) } ` ) ;
9799 const { addonName, addonAuthor } = params ;
98100 const templateFile = addonTemplate [ type ] . config ;
99101 const addonConfigPath = path . resolve (
@@ -136,7 +138,15 @@ function maybeExecuteInitScript(addonPath) {
136138 const initScriptPath = path . resolve ( process . cwd ( ) , addonPath , "init.js" ) ;
137139 if ( fs . existsSync ( initScriptPath ) ) {
138140 console . log ( `${ chalk . white . bold ( "executing init script ..." ) } ` ) ;
139- require ( initScriptPath ) ;
141+ const init = require ( initScriptPath ) ;
142+ init ( )
143+ . then ( ( ) => {
144+ resolve ( ) ;
145+ } )
146+ . catch ( ( err ) => {
147+ console . error ( err ) ;
148+ reject ( err ) ;
149+ } ) ;
140150 } else {
141151 resolve ( ) ;
142152 }
Original file line number Diff line number Diff line change 11{
22 "name" : " c3ide2-cli" ,
33 "description" : " A simple CLI for scaffolding construct 3 addons using c3ide2-framework" ,
4- "version" : " 1.2.1 " ,
4+ "version" : " 1.2.2 " ,
55 "main" : " index.js" ,
66 "license" : " MIT" ,
77 "dependencies" : {
You can’t perform that action at this time.
0 commit comments