Skip to content

Commit 86db3c5

Browse files
committed
fix: Call single-line commands only at execSync (closes #3)
1 parent a082dbc commit 86db3c5

File tree

1 file changed

+9
-15
lines changed

1 file changed

+9
-15
lines changed

Diff for: index.js

+9-15
Original file line numberDiff line numberDiff line change
@@ -45,28 +45,22 @@ console.log(`Starting script "${config.script}"...`);
4545
console.log(execSync(`${config.script}`, { cwd }).toString('utf-8'));
4646

4747
console.log('Configuring and committing...');
48-
execSync(`
49-
cd ${config.folder} &&
50-
git config user.email "${config.user_email}" &&
51-
git config user.name "${config.user_name}" &&
52-
git add . &&
53-
git commit --allow-empty -m "${config.commit}"
54-
`, { cwd });
48+
execSync([
49+
`cd ${config.folder}`,
50+
`git config user.email "${config.user_email}"`,
51+
`git config user.name "${config.user_name}"`,
52+
'git add .',
53+
`git commit --allow-empty -m "${config.commit}"`
54+
].join('&&'), { cwd });
5555

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

59-
execSync(`
60-
cd ${config.folder} &&
61-
${config.beforePushScript}
62-
`, { cwd });
59+
execSync(`cd ${config.folder} && ${config.beforePushScript}`, { cwd });
6360
}
6461

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

67-
execSync(`
68-
cd ${config.folder} &&
69-
git push --tags ${config.repository} ${config.branch}
70-
`, { cwd });
64+
execSync(`cd ${config.folder} && git push --tags ${config.repository} ${config.branch}`, { cwd });
7165

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

0 commit comments

Comments
 (0)