@noahyu/cd-cli 1.3.3 → 1.3.4

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 CHANGED
@@ -145,7 +145,13 @@ 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 result = await ssh.execCommand(`bash --login -c ${JSON.stringify(cmd)}`, {
148
+ const wrappedCmd = [
149
+ '[ -f /etc/profile ] && . /etc/profile 2>/dev/null || true',
150
+ '[ -f ~/.bash_profile ] && . ~/.bash_profile 2>/dev/null || true',
151
+ '[ -f ~/.bashrc ] && . ~/.bashrc 2>/dev/null || true',
152
+ cmd,
153
+ ].join('; ');
154
+ const result = await ssh.execCommand(`bash -c ${JSON.stringify(wrappedCmd)}`, {
149
155
  cwd: config.server.deployPath,
150
156
  });
151
157
  if (result.stdout) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@noahyu/cd-cli",
3
- "version": "1.3.3",
3
+ "version": "1.3.4",
4
4
  "description": "Global CLI tool for simple project deployment with version management",
5
5
  "type": "module",
6
6
  "main": "./dist/bin/cli.js",