fix stdout pipe buffer blocking during package installation
This commit is contained in:
6
bin/builders/BaseBuilder.ts
vendored
6
bin/builders/BaseBuilder.ts
vendored
@@ -120,15 +120,17 @@ export default abstract class BaseBuilder {
|
||||
const projectCnConf = path.join(tauriSrcPath, 'rust_proxy.toml');
|
||||
await fsExtra.copy(projectCnConf, projectConf);
|
||||
await shellExec(
|
||||
`cd "${npmDirectory}" && ${packageManager} install${registryOption}${peerDepsOption} --silent`,
|
||||
`cd "${npmDirectory}" && ${packageManager} install${registryOption}${peerDepsOption}`,
|
||||
timeout,
|
||||
buildEnv,
|
||||
this.options.debug,
|
||||
);
|
||||
} else {
|
||||
await shellExec(
|
||||
`cd "${npmDirectory}" && ${packageManager} install${peerDepsOption} --silent`,
|
||||
`cd "${npmDirectory}" && ${packageManager} install${peerDepsOption}`,
|
||||
timeout,
|
||||
buildEnv,
|
||||
this.options.debug,
|
||||
);
|
||||
}
|
||||
spinner.succeed(chalk.green('Package installed!'));
|
||||
|
||||
3
bin/helpers/rust.ts
vendored
3
bin/helpers/rust.ts
vendored
@@ -81,6 +81,9 @@ export async function installRust() {
|
||||
try {
|
||||
await shellExec(
|
||||
IS_WIN ? rustInstallScriptForWindows : rustInstallScriptForMac,
|
||||
300000,
|
||||
undefined,
|
||||
true,
|
||||
);
|
||||
spinner.succeed(chalk.green('✔ Rust installed successfully!'));
|
||||
ensureRustEnv();
|
||||
|
||||
3
bin/utils/shell.ts
vendored
3
bin/utils/shell.ts
vendored
@@ -5,11 +5,12 @@ export async function shellExec(
|
||||
command: string,
|
||||
timeout: number = 300000,
|
||||
env?: Record<string, string>,
|
||||
showOutput: boolean = false,
|
||||
) {
|
||||
try {
|
||||
const { exitCode } = await execa(command, {
|
||||
cwd: npmDirectory,
|
||||
stdio: ['inherit', 'pipe', 'inherit'], // Hide stdout verbose, keep stderr
|
||||
stdio: showOutput ? 'inherit' : ['inherit', 'pipe', 'inherit'],
|
||||
shell: true,
|
||||
timeout,
|
||||
env: env ? { ...process.env, ...env } : process.env,
|
||||
|
||||
Reference in New Issue
Block a user