File tree Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -26,7 +26,12 @@ for (const field of fields) {
2626
2727console . log ( 'Deploying to git...' ) ;
2828console . log ( `Cloning to ${ config . folder } ...` ) ;
29- execSync ( `git clone -b ${ config . branch } ${ config . repository } ${ config . folder } 2>&1` , { cwd } ) ;
29+ try {
30+ execSync ( `git clone -b ${ config . branch } ${ config . repository } ${ config . folder } 2>&1` , { cwd } ) ;
31+ } catch ( e ) {
32+ throw Error ( 'Failed to clone.' ) ;
33+ }
34+
3035
3136console . log ( `Starting script ${ config . script } ...` ) ;
3237console . log ( execSync ( `${ config . script } ` , { cwd } ) . toString ( 'utf-8' ) ) ;
@@ -41,6 +46,14 @@ execSync(`
4146` , { cwd } ) ;
4247
4348console . log ( 'Pushing...' ) ;
44- execSync ( `git push ${ config . repository } ${ config . branch } ` , { cwd } ) ;
49+ try {
50+ execSync ( `
51+ cd ${ config . folder } &&
52+ git push ${ config . repository } ${ config . branch } 2>&1
53+ ` , { cwd } ) ;
54+ } catch ( e ) {
55+ throw Error ( 'Failed to push.' )
56+ }
57+
4558
4659console . log ( 'Deploying to git is finished.' ) ;
You can’t perform that action at this time.
0 commit comments