File tree Expand file tree Collapse file tree 2 files changed +7
-8
lines changed
Expand file tree Collapse file tree 2 files changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -9,4 +9,6 @@ if (!process.argv[2]) {
99 process . exit ( 1 ) ;
1010}
1111
12- require ( ".." ) . main ( process . argv [ 2 ] ) ;
12+ require ( ".." ) . main ( process . argv [ 2 ] )
13+ . then ( console . log )
14+ . catch ( err => console . log ( err . message ) ) ;
Original file line number Diff line number Diff line change @@ -87,7 +87,7 @@ function getProjectManifest(projectDirName) {
8787
8888exports . main = function main ( dirPath ) {
8989 if ( ! dirPath ) {
90- throw new Error ( "Project directory name is a compulsory argument" ) ;
90+ throw new Error ( "Project directory name is a mandatory argument" ) ;
9191 }
9292
9393 const projectPath = path . resolve ( dirPath ) ;
@@ -106,16 +106,13 @@ exports.main = function main(dirPath) {
106106 . then ( ( ) => getProjectReadme ( projectDirName ) )
107107 . then ( projectReadme => fs . writeFile ( path . join ( projectPath , "README.md" ) ,
108108 stripAnsi ( projectReadme ) ) )
109- . then ( ( ) => getProjectCreatedMessage ( projectPath ) )
110- . then ( console . log ) ;
109+ . then ( ( ) => getProjectCreatedMessage ( projectPath ) ) ;
111110 } , error => {
112111 if ( error . code === "EEXIST" ) {
113112 const msg = `Unable to create a new WebExtension: ${ chalk . bold . underline ( projectPath ) } dir already exist.` ;
114- console . error ( `${ chalk . red ( msg ) } \n` ) ;
115- process . exit ( 1 ) ;
113+ throw new Error ( msg ) ;
116114 }
117115 } ) . catch ( ( error ) => {
118- console . error ( error ) ;
119- process . exit ( 1 ) ;
116+ throw error ;
120117 } ) ;
121118} ;
You can’t perform that action at this time.
0 commit comments