Skip to content

Commit

Permalink
fix: Call single-line commands only at execSync (closes #3)
Browse files Browse the repository at this point in the history
  • Loading branch information
finom committed Jul 4, 2017
1 parent a082dbc commit 86db3c5
Showing 1 changed file with 9 additions and 15 deletions.
24 changes: 9 additions & 15 deletions index.js
Expand Up @@ -45,28 +45,22 @@ console.log(`Starting script "${config.script}"...`);
console.log(execSync(`${config.script}`, { cwd }).toString('utf-8'));

console.log('Configuring and committing...');
execSync(`
cd ${config.folder} &&
git config user.email "${config.user_email}" &&
git config user.name "${config.user_name}" &&
git add . &&
git commit --allow-empty -m "${config.commit}"
`, { cwd });
execSync([
`cd ${config.folder}`,
`git config user.email "${config.user_email}"`,
`git config user.name "${config.user_name}"`,
'git add .',
`git commit --allow-empty -m "${config.commit}"`
].join('&&'), { cwd });

if (config.beforePushScript) {
console.log('Running beforePushScript...');

execSync(`
cd ${config.folder} &&
${config.beforePushScript}
`, { cwd });
execSync(`cd ${config.folder} && ${config.beforePushScript}`, { cwd });
}

console.log('Pushing...');

execSync(`
cd ${config.folder} &&
git push --tags ${config.repository} ${config.branch}
`, { cwd });
execSync(`cd ${config.folder} && git push --tags ${config.repository} ${config.branch}`, { cwd });

console.log('Deploying to git is finished.');

0 comments on commit 86db3c5

Please sign in to comment.