File tree 1 file changed +16
-9
lines changed
1 file changed +16
-9
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ import path from "path";
2
2
import validate from "validate-npm-package-name" ;
3
3
import { exec } from "child_process" ;
4
4
import { promisify } from "util" ;
5
+ import chalk from "chalk" ;
5
6
6
7
import { GeneratorConfig , Action } from "../@types/sao" ;
7
8
import {
@@ -295,15 +296,21 @@ const saoConfig: GeneratorConfig = {
295
296
* Create an initial commit
296
297
*/
297
298
if ( ! debug ) {
298
- // add
299
- await promisify ( exec ) (
300
- `git --git-dir=${ saoInstance . outDir } /.git/ --work-tree=${ saoInstance . outDir } / add -A` ,
301
- ) ;
302
- // commit
303
- await promisify ( exec ) (
304
- `git --git-dir=${ saoInstance . outDir } /.git/ --work-tree=${ saoInstance . outDir } / commit -m 'initial commit with superplate'` ,
305
- ) ;
306
- saoInstance . logger . info ( "created an initial commit." ) ;
299
+ try {
300
+ // add
301
+ await promisify ( exec ) (
302
+ `git --git-dir=${ saoInstance . outDir } /.git/ --work-tree=${ saoInstance . outDir } / add -A` ,
303
+ ) ;
304
+ // commit
305
+ await promisify ( exec ) (
306
+ `git --git-dir=${ saoInstance . outDir } /.git/ --work-tree=${ saoInstance . outDir } / commit -m "initial commit with superplate"` ,
307
+ ) ;
308
+ saoInstance . logger . info ( "created an initial commit." ) ;
309
+ } catch ( _ ) {
310
+ console . log (
311
+ chalk . yellow `An error occured while creating git commit.` ,
312
+ ) ;
313
+ }
307
314
}
308
315
309
316
/**
You can’t perform that action at this time.
0 commit comments