-
-
Notifications
You must be signed in to change notification settings - Fork 203
fix: Tauri setup command errors with string escaping on Windows with Bun #355
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
fix: Tauri setup command errors with string escaping on Windows with Bun #355
Conversation
|
WalkthroughThe setup logic for invoking the Tauri CLI in the project has been refactored to handle a special case: when running on Windows with the "bun" package manager, the command execution method changes from a shell command string to a direct executable with arguments. Common argument construction and variable reuse have been improved. Changes
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🧰 Additional context used🧬 Code Graph Analysis (1)apps/cli/src/helpers/setup/tauri-setup.ts (1)
🔇 Additional comments (6)
|
6227ae8
to
864e863
Compare
d52a083
to
fcbdd0d
Compare
889c085
to
b167db0
Compare
i have the same issue PS C:\github\test> bun create better-t-stack@latest testA --frontend next native-nativewind --backend self --runtime none --api orpc --auth better-auth --payments polar --database postgres --orm drizzle --db-setup neon --package-manager bun --git --web-deploy none --server-deploy none --install --addons biome pwa tauri turborepo --examples none
██████╗ ███████╗████████╗████████╗███████╗██████╗
██╔══██╗██╔════╝╚══██╔══╝╚══██╔══╝██╔════╝██╔══██╗
██████╔╝█████╗ ██║ ██║ █████╗ ██████╔╝
██╔══██╗██╔══╝ ██║ ██║ ██╔══╝ ██╔══██╗
██████╔╝███████╗ ██║ ██║ ███████╗██║ ██║
╚═════╝ ╚══════╝ ╚═╝ ╚═╝ ╚══════╝╚═╝ ╚═╝
████████╗ ███████╗████████╗ █████╗ ██████╗██╗ ██╗
╚══██╔══╝ ██╔════╝╚══██╔══╝██╔══██╗██╔════╝██║ ██╔╝
██║ ███████╗ ██║ ███████║██║ █████╔╝
██║ ╚════██║ ██║ ██╔══██║██║ ██╔═██╗
██║ ███████║ ██║ ██║ ██║╚██████╗██║ ██╗
╚═╝ ╚══════╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝
┌ Creating a new Better-T-Stack project
│
● Using these pre-selected options:
│
│ Frontend: next, native-nativewind
│ Backend: self
│ Runtime: none
│ API: orpc
│ Database: postgres
│ ORM: drizzle
│ Auth: better-auth
│ Payments: polar
│ Addons: biome, pwa, tauri, turborepo
│ Examples: none
│ Git Init: Yes
│ Package Manager: bun
│ Install Dependencies: Yes
│ Database Setup: neon
│ Web Deployment: none
│ Server Deployment: none
│
│
│
◇ Neon setup: choose mode
│ Manual
│
● Manual Neon PostgreSQL Setup Instructions:
│
│ 1. Visit https://neon.tech and create an account
│ 2. Create a new project from the dashboard
│ 3. Get your connection string
│ 4. Add the database URL to the .env file in apps/web/.env
│
│ DATABASE_URL="your_connection_string"
│
◇ Failed to set up Tauri
[9:06:35 pm] ERROR Command failed with exit code 2: "bunx @tauri-apps/cli@latest init --app-name=testA --window-title=testA --frontend-dist=../.next --dev-url=http://localhost:3001 --before-dev-command=""bun run dev"" --before-build-command=""bun run build"""
Resolving dependencies
Resolved, downloaded and extracted [2]
Saved lockfile
error: unexpected argument 'run' found
Usage: bun run bunx init [OPTIONS]
For more information, try '--help'.
│
◆ Project template successfully scaffolded!
│
warn: incorrect peer dependency "@types/[email protected]"
warn: incorrect peer dependency "@polar-sh/[email protected]"
warn: incorrect peer dependency "[email protected]"
warn: incorrect peer dependency "[email protected]"
warn: incorrect peer dependency "[email protected]"
warn: incorrect peer dependency "[email protected]"
◇ Canceled
PS C:\github\test> ^C |
For some reason, when running the generator with the Tauri setup, bunx encounters an issue with parsing the arg command string (eg.
--before-dev-build="bun run dev"
).This is happening only on Windows (powershell) with Bun. So I added a check in tauri-setup for that specific setup and used direct arguments without shell execution. Not sure if this is something Bun has to fix on their end as pnpm and npm works with no issues. Regardless of that, this PR introduces a workaround to the issue.
Summary by CodeRabbit