Skip to content

Commit

Permalink
fix: 在 spawnSync 调用中添加 shell 选项以提高兼容性
Browse files Browse the repository at this point in the history
  • Loading branch information
muxiangqiu committed Jan 14, 2025
1 parent 2b36081 commit 65aaffa
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# Change

## 3.4.0
## 3.4.2

- fix: 在 spawnSync 调用中添加 shell 选项以提高兼容性

## 3.4.1

- feat(ai-anthropic): 添加新组件 `@celljs/ai-anthropic`,支持 Anthropic 模型及其 API

Expand Down
2 changes: 1 addition & 1 deletion cloud-packages/vercel-adapter/src/hooks/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ export default async (context: DeployContext) => {
args.push('--prod');
}
args.push(...['--local-config', join(PathUtil.getProjectHomePath(), 'vercel.json')]);
spawnSync('vercel', { cwd: PathUtil.getProjectHomePath(), stdio: 'inherit' });
spawnSync('vercel', { cwd: PathUtil.getProjectHomePath(), stdio: 'inherit', shell: true });
};
4 changes: 2 additions & 2 deletions dev-packages/cli-common/src/packager/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ export class SpawnError extends Error {
export function spawnProcess(command: string, args: string[], options: any) {
return new Promise<any>((resolve, reject) => {
if (options && options.stdio === 'inherit') {
spawnSync(command, args, options);
spawnSync(command, args, { shell: true, ...options });
resolve({});
} else {
const child = spawn(command, args, options);
const child = spawn(command, args, { shell: true, ...options });
let stdout = '';
let stderr = '';
child.stdout.setEncoding('utf8');
Expand Down
2 changes: 1 addition & 1 deletion dev-packages/cli/src/init/init-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,6 @@ export class InitManager {

protected outputRemoteTempate(): Promise<any> {
const dir = this.opts.outputDir ? [ this.opts.outputDir ] : [];
return spawnProcess('git', [ 'clone', '--depth=1', this.location, ...dir ], { stdio: 'inherit' });
return spawnProcess('git', [ 'clone', '--depth=1', this.location, ...dir ], { stdio: 'inherit', shell: true });
}
}

0 comments on commit 65aaffa

Please sign in to comment.