Skip to content

Commit 9286cab

Browse files
committed
OMG inherit parent env -_-
1 parent 0d5ecdd commit 9286cab

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

deploy.js

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,23 @@ const sitesDir = path.join(monoRepoDir, 'sites');
1818

1919
const sites = readdirSync(sitesDir);
2020

21-
const execIn = cwd => (command, options = {}) => (
21+
const exec = (cmd, options = {}) => (
2222
execSync(command, Object.assign(
23-
{ stdio: 'inherit' },
24-
options,
25-
{ cwd }
23+
{ stdio: 'inherit', env: process.env },
24+
options
2625
))
26+
)
27+
28+
const execIn = cwd => (command, options = {}) => (
29+
exec(command, Object.assign(options, { cwd }))
2730
);
2831

2932
const monoRepoExec = execIn(monoRepoDir);
3033

3134
console.log(`\nStarting deploy script for [ ${sites.join(', ')} ]\n`)
3235

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"');
3538

3639
sites.forEach(site => {
3740
const siteDir = path.join(sitesDir, site);
@@ -65,7 +68,7 @@ sites.forEach(site => {
6568

6669
try {
6770
console.log(`\nCloning ${site} deployment repo from ${repository.url}\n`);
68-
execSync(`git clone ${repository.url} ${tmpDir}`);
71+
exec(`git clone ${repository.url} ${tmpDir}`);
6972

7073
deployCloneExec(`cp -Rf ${path.join(siteDir, buildDir)}/* .`);
7174
} catch (err) {
@@ -106,7 +109,7 @@ sites.forEach(site => {
106109
}
107110
}
108111

109-
execSync(`rm -Rf ${tmpDir}`);
112+
exec(`rm -Rf ${tmpDir}`);
110113
});
111114

112115
function ignorePathspec (ignores) {

0 commit comments

Comments
 (0)