diff --git a/bin/utils/shell.ts b/bin/utils/shell.ts index 77d8051..f2a9bc0 100644 --- a/bin/utils/shell.ts +++ b/bin/utils/shell.ts @@ -6,11 +6,14 @@ export async function shellExec(command: string) { const { exitCode } = await execa(command, { cwd: npmDirectory, stdio: 'inherit', + shell: true, }); return exitCode; - } catch (error) { + } catch (error: any) { + const exitCode = error.exitCode ?? 'unknown'; + const errorMessage = error.message || 'Unknown error occurred'; throw new Error( - `Error occurred while executing command "${command}". Exit code: ${error.exitCode}`, + `Error occurred while executing command "${command}". Exit code: ${exitCode}. Details: ${errorMessage}`, ); } } diff --git a/dist/cli.js b/dist/cli.js index 204bd69..d32429c 100644 --- a/dist/cli.js +++ b/dist/cli.js @@ -19,7 +19,7 @@ import { fileTypeFromBuffer } from 'file-type'; import * as psl from 'psl'; var name = "pake-cli"; -var version$1 = "3.2.0-beta"; +var version$1 = "3.2.0-beta1"; var description = "🤱🏻 Turn any webpage into a desktop app with Rust. 🤱🏻 利用 Rust 轻松构建轻量级多端桌面应用。"; var engines = { node: ">=16.0.0" @@ -319,11 +319,14 @@ async function shellExec(command) { const { exitCode } = await execa(command, { cwd: npmDirectory, stdio: 'inherit', + shell: true, }); return exitCode; } catch (error) { - throw new Error(`Error occurred while executing command "${command}". Exit code: ${error.exitCode}`); + const exitCode = error.exitCode ?? 'unknown'; + const errorMessage = error.message || 'Unknown error occurred'; + throw new Error(`Error occurred while executing command "${command}". Exit code: ${exitCode}. Details: ${errorMessage}`); } } diff --git a/package.json b/package.json index c55fcc1..f36bda2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pake-cli", - "version": "3.2.0-beta", + "version": "3.2.0-beta1", "description": "🤱🏻 Turn any webpage into a desktop app with Rust. 🤱🏻 利用 Rust 轻松构建轻量级多端桌面应用。", "engines": { "node": ">=16.0.0"