diff --git a/bin/builders/BaseBuilder.ts b/bin/builders/BaseBuilder.ts index 9a20f92..c649f67 100644 --- a/bin/builders/BaseBuilder.ts +++ b/bin/builders/BaseBuilder.ts @@ -255,7 +255,7 @@ export default abstract class BaseBuilder { ? `${packageManager} run build:debug` : `${packageManager} run build`; - const argSeparator = ' --'; // Both npm and pnpm need -- to pass args to scripts + const argSeparator = packageManager === 'npm' ? ' --' : ''; let fullCommand = `${baseCommand}${argSeparator} -c "${configPath}"`; if (target) { @@ -283,10 +283,6 @@ export default abstract class BaseBuilder { } protected getBuildCommand(packageManager: string = 'pnpm'): string { - const baseCommand = this.options.debug - ? `${packageManager} run build:debug` - : `${packageManager} run build`; - // Use temporary config directory to avoid modifying source files const configPath = path.join( npmDirectory, @@ -294,7 +290,8 @@ export default abstract class BaseBuilder { '.pake', 'tauri.conf.json', ); - let fullCommand = `${baseCommand} -- -c "${configPath}"`; + + let fullCommand = this.buildBaseCommand(packageManager, configPath); // For macOS, use app bundles by default unless DMG is explicitly requested if (IS_MAC && this.options.targets === 'app') { diff --git a/bin/builders/WinBuilder.ts b/bin/builders/WinBuilder.ts index 0f6fda9..a7c0eaa 100644 --- a/bin/builders/WinBuilder.ts +++ b/bin/builders/WinBuilder.ts @@ -26,10 +26,6 @@ export default class WinBuilder extends BaseBuilder { } protected getBuildCommand(packageManager: string = 'pnpm'): string { - const baseCommand = this.options.debug - ? `${packageManager} run build:debug` - : `${packageManager} run build`; - const configPath = path.join('src-tauri', '.pake', 'tauri.conf.json'); const buildTarget = this.getTauriTarget(this.buildArch, 'win32'); @@ -39,7 +35,11 @@ export default class WinBuilder extends BaseBuilder { ); } - let fullCommand = `${baseCommand} -- -c "${configPath}" --target ${buildTarget}`; + let fullCommand = this.buildBaseCommand( + packageManager, + configPath, + buildTarget, + ); // Add features const features = this.getBuildFeatures(); diff --git a/dist/cli.js b/dist/cli.js index 5601fbf..6e54294 100755 --- a/dist/cli.js +++ b/dist/cli.js @@ -54,9 +54,9 @@ var files = [ var scripts = { start: "pnpm run dev", dev: "pnpm run tauri dev", - build: "pnpm run tauri build --", - "build:debug": "pnpm run tauri build -- --debug", - "build:mac": "pnpm run tauri build -- --target universal-apple-darwin", + build: "tauri build", + "build:debug": "tauri build --debug", + "build:mac": "tauri build --target universal-apple-darwin", "build:config": "chmod +x scripts/configure-tauri.mjs && node scripts/configure-tauri.mjs", analyze: "cd src-tauri && cargo bloat --release --crates", tauri: "tauri", @@ -742,7 +742,7 @@ class BaseBuilder { const baseCommand = this.options.debug ? `${packageManager} run build:debug` : `${packageManager} run build`; - const argSeparator = ' --'; // Both npm and pnpm need -- to pass args to scripts + const argSeparator = packageManager === 'npm' ? ' --' : ''; let fullCommand = `${baseCommand}${argSeparator} -c "${configPath}"`; if (target) { fullCommand += ` --target ${target}`; @@ -764,12 +764,9 @@ class BaseBuilder { return features; } getBuildCommand(packageManager = 'pnpm') { - const baseCommand = this.options.debug - ? `${packageManager} run build:debug` - : `${packageManager} run build`; // Use temporary config directory to avoid modifying source files const configPath = path.join(npmDirectory, 'src-tauri', '.pake', 'tauri.conf.json'); - let fullCommand = `${baseCommand} -- -c "${configPath}"`; + let fullCommand = this.buildBaseCommand(packageManager, configPath); // For macOS, use app bundles by default unless DMG is explicitly requested if (IS_MAC && this.options.targets === 'app') { fullCommand += ' --bundles app'; @@ -924,15 +921,12 @@ class WinBuilder extends BaseBuilder { return `${name}_${tauriConfig.version}_${targetArch}_${language}`; } getBuildCommand(packageManager = 'pnpm') { - const baseCommand = this.options.debug - ? `${packageManager} run build:debug` - : `${packageManager} run build`; const configPath = path.join('src-tauri', '.pake', 'tauri.conf.json'); const buildTarget = this.getTauriTarget(this.buildArch, 'win32'); if (!buildTarget) { throw new Error(`Unsupported architecture: ${this.buildArch} for Windows`); } - let fullCommand = `${baseCommand} -- -c "${configPath}" --target ${buildTarget}`; + let fullCommand = this.buildBaseCommand(packageManager, configPath, buildTarget); // Add features const features = this.getBuildFeatures(); if (features.length > 0) { diff --git a/package.json b/package.json index 3dc5ea6..b2346fb 100644 --- a/package.json +++ b/package.json @@ -32,9 +32,9 @@ "scripts": { "start": "pnpm run dev", "dev": "pnpm run tauri dev", - "build": "pnpm run tauri build --", - "build:debug": "pnpm run tauri build -- --debug", - "build:mac": "pnpm run tauri build -- --target universal-apple-darwin", + "build": "tauri build", + "build:debug": "tauri build --debug", + "build:mac": "tauri build --target universal-apple-darwin", "build:config": "chmod +x scripts/configure-tauri.mjs && node scripts/configure-tauri.mjs", "analyze": "cd src-tauri && cargo bloat --release --crates", "tauri": "tauri",