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) {
26
26
27
27
console . log ( 'Deploying to git...' ) ;
28
28
console . 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
+
30
35
31
36
console . log ( `Starting script ${ config . script } ...` ) ;
32
37
console . log ( execSync ( `${ config . script } ` , { cwd } ) . toString ( 'utf-8' ) ) ;
@@ -41,6 +46,14 @@ execSync(`
41
46
` , { cwd } ) ;
42
47
43
48
console . 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
+
45
58
46
59
console . log ( 'Deploying to git is finished.' ) ;
You can’t perform that action at this time.
0 commit comments