@@ -18,20 +18,23 @@ const sitesDir = path.join(monoRepoDir, 'sites');
18
18
19
19
const sites = readdirSync ( sitesDir ) ;
20
20
21
- const execIn = cwd => ( command , options = { } ) => (
21
+ const exec = ( cmd , options = { } ) => (
22
22
execSync ( command , Object . assign (
23
- { stdio : 'inherit' } ,
24
- options ,
25
- { cwd }
23
+ { stdio : 'inherit' , env : process . env } ,
24
+ options
26
25
) )
26
+ )
27
+
28
+ const execIn = cwd => ( command , options = { } ) => (
29
+ exec ( command , Object . assign ( options , { cwd } ) )
27
30
) ;
28
31
29
32
const monoRepoExec = execIn ( monoRepoDir ) ;
30
33
31
34
console . log ( `\nStarting deploy script for [ ${ sites . join ( ', ' ) } ]\n` )
32
35
33
- execSync ( 'git config --global user.name "WWWTF Deploy Bot"' ) ;
34
- execSync ( 'git config --global user.email "deploy@wwwtf.berlin"' ) ;
36
+ exec ( 'git config --global user.name "WWWTF Deploy Bot"' ) ;
37
+ exec ( 'git config --global user.email "deploy@wwwtf.berlin"' ) ;
35
38
36
39
sites . forEach ( site => {
37
40
const siteDir = path . join ( sitesDir , site ) ;
@@ -65,7 +68,7 @@ sites.forEach(site => {
65
68
66
69
try {
67
70
console . log ( `\nCloning ${ site } deployment repo from ${ repository . url } \n` ) ;
68
- execSync ( `git clone ${ repository . url } ${ tmpDir } ` ) ;
71
+ exec ( `git clone ${ repository . url } ${ tmpDir } ` ) ;
69
72
70
73
deployCloneExec ( `cp -Rf ${ path . join ( siteDir , buildDir ) } /* .` ) ;
71
74
} catch ( err ) {
@@ -106,7 +109,7 @@ sites.forEach(site => {
106
109
}
107
110
}
108
111
109
- execSync ( `rm -Rf ${ tmpDir } ` ) ;
112
+ exec ( `rm -Rf ${ tmpDir } ` ) ;
110
113
} ) ;
111
114
112
115
function ignorePathspec ( ignores ) {
0 commit comments