@noahyu/cd-cli 1.3.3 → 1.3.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/index.js +8 -1
- package/package.json +1 -1
package/dist/src/index.js
CHANGED
|
@@ -145,7 +145,14 @@ async function deploy(config, version) {
|
|
|
145
145
|
if (config.afterDeploy) {
|
|
146
146
|
for (const cmd of config.afterDeploy) {
|
|
147
147
|
spinner.start(`执行部署后命令: ${cmd}`);
|
|
148
|
-
const
|
|
148
|
+
const inner = [
|
|
149
|
+
'export PS1="x"',
|
|
150
|
+
'[ -f /etc/profile ] && . /etc/profile 2>/dev/null || true',
|
|
151
|
+
'[ -f ~/.bash_profile ] && . ~/.bash_profile 2>/dev/null || true',
|
|
152
|
+
'[ -f ~/.bashrc ] && . ~/.bashrc 2>/dev/null || true',
|
|
153
|
+
cmd,
|
|
154
|
+
].join('; ');
|
|
155
|
+
const result = await ssh.execCommand(`bash -l -c ${JSON.stringify(inner)}`, {
|
|
149
156
|
cwd: config.server.deployPath,
|
|
150
157
|
});
|
|
151
158
|
if (result.stdout) {
|