Skip to content

fix(v3): fix macOS mkdir brace expansion when APP_NAME contains spaces - #4850

Merged
leaanthony merged 2 commits into
v3-alphafrom
fix/darwin-mkdir-brace-expansion
Jan 4, 2026
Merged

leaanthony merged 2 commits into
v3-alphafrom
fix/darwin-mkdir-brace-expansion

Conversation

@leaanthony

@leaanthony leaanthony commented Jan 4, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Fix macOS app bundle creation failing when APP_NAME contains spaces
  • Brace expansion {MacOS,Resources} doesn't work inside quoted strings, creating a literal {MacOS,Resources} directory
  • Fix by quoting path segments individually, leaving brace expansion outside quotes

Changes

  • v3/internal/commands/build_assets/darwin/Taskfile.yml: Fix quoting in create:app:bundle and run tasks
  • v3/internal/commands/task_integration_test.go: Add integration test to verify brace expansion works with spaces in paths

Context

Reported in #4845 (comment)

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

  • New integration test TestBraceExpansionWithSpacesInPath verifies:
    • Correct quoting creates separate MacOS and Resources directories
    • Broken quoting creates literal {MacOS,Resources} directory

Checklist

  • I have read the CONTRIBUTING document
  • My code follows the code style of this project
  • I have updated v3/UNRELEASED_CHANGELOG.md with a description of my changes

Summary by CodeRabbit

  • Bug Fixes

    • Fixed macOS app bundle creation when the application name contains spaces.
  • Tests

    • Added an integration test to verify correct handling of file paths with spaces.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai

coderabbitai Bot commented Jan 4, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Rate limit exceeded

@leaanthony has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 3 minutes and 58 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between ca66f77 and beca817.

📒 Files selected for processing (3)
  • v3/UNRELEASED_CHANGELOG.md
  • v3/internal/commands/build_assets/darwin/Taskfile.yml
  • v3/internal/commands/task_integration_test.go

Walkthrough

Updates macOS Taskfile directory creation to use two explicit mkdir commands, adds an integration test for creating bundles when paths contain spaces, and documents the fix in the unreleased changelog.

Changes

Cohort / File(s) Summary
Changelog
v3/UNRELEASED_CHANGELOG.md
Added Fixed entry noting macOS app bundle creation failure when APP_NAME contains spaces due to brace expansion.
Darwin Taskfile
v3/internal/commands/build_assets/darwin/Taskfile.yml
Replaced a single mkdir -p Contents/{MacOS,Resources} with two separate mkdir -p commands (Contents/MacOS and Contents/Resources), making directory creation explicit.
Tests
v3/internal/commands/task_integration_test.go
Added TestMkdirWithSpacesInPath integration test that creates a Taskfile with a space-containing path, runs bundle creation, and asserts MacOS and Resources directories exist; minor formatting tweaks and trailing newline added.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested labels

cli, v3-alpha

Poem

🐰 I hopped through folders, spaces gave a scare,
Braces went wild and scattered everywhere.
Two mkdirs later, neat bundles appear,
Tests thump my foot — the app’s safe and clear. 🥕✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main fix: resolving macOS mkdir brace expansion issues when APP_NAME contains spaces.
Description check ✅ Passed The description covers the summary, root cause, changes made, testing approach, and checklist items; it is well-structured and comprehensive.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jan 4, 2026 •

Copy link
Copy Markdown

Deploying wails with  Cloudflare Pages  Cloudflare Pages

Latest commit: beca817
Status: ✅  Deploy successful!
Preview URL: https://e51ebe00.wails.pages.dev
Branch Preview URL: https://fix-darwin-mkdir-brace-expan.wails.pages.dev

View logs

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9039051 and 1fe4927.

📒 Files selected for processing (3)
  • v3/UNRELEASED_CHANGELOG.md
  • v3/internal/commands/build_assets/darwin/Taskfile.yml
  • v3/internal/commands/task_integration_test.go
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2024-10-08T22:11:37.054Z
Learnt from: leaanthony
Repo: wailsapp/wails PR: 3748
File: v3/internal/templates/_common/Taskfile.tmpl.yml:18-18
Timestamp: 2024-10-08T22:11:37.054Z
Learning: In Taskfile, variables are referenced using `{{ "{{variable}}" }}` without the dot notation.

Applied to files:

  • v3/internal/commands/build_assets/darwin/Taskfile.yml
🧬 Code graph analysis (1)
v3/internal/commands/task_integration_test.go (1)
v3/internal/commands/task.go (2)
  • RunTask (51-185)
  • RunTaskOptions (24-49)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
  • GitHub Check: Run Go Tests v3 (macos-latest, 1.24)
  • GitHub Check: Run Go Tests v3 (windows-latest, 1.24)
  • GitHub Check: Run Go Tests v3 (ubuntu-latest, 1.24)
  • GitHub Check: Analyze (go)
  • GitHub Check: semgrep-cloud-platform/scan
  • GitHub Check: Cloudflare Pages
🔇 Additional comments (5)
v3/UNRELEASED_CHANGELOG.md (1)

38-38: LGTM!

Clear and concise changelog entry that describes both the symptom (app bundle creation failing with spaces in APP_NAME) and the root cause (brace expansion issue).

v3/internal/commands/build_assets/darwin/Taskfile.yml (2)

141-141: LGTM!

The fix correctly addresses the brace expansion issue. By quoting path segments individually ("{{.BIN_DIR}}"/"{{.APP_NAME}}") and leaving the brace expansion {MacOS,Resources} outside quotes, the shell can now properly expand the braces while still protecting spaces in variable values.


161-161: LGTM!

Consistent application of the fix to the dev app bundle creation in the run task.

v3/internal/commands/task_integration_test.go (2)

291-298: Well-documented test with clear purpose.

The comment effectively explains the shell quoting behavior being tested and why the fix works. The CI skip condition follows the existing pattern in this file.


300-322: Good test setup with representative data.

Using "My App" with a space in the name directly exercises the bug scenario. The Taskfile structure mirrors the production fix, which makes this an effective regression test.

Comment thread v3/internal/commands/task_integration_test.go Outdated
@leaanthony
leaanthony force-pushed the fix/darwin-mkdir-brace-expansion branch 2 times, most recently from ea9c8a3 to ca66f77 Compare January 4, 2026 04:08
Replace brace expansion {MacOS,Resources} with two separate mkdir commands.
Brace expansion doesn't work inside quoted strings and is shell-dependent.

Adds integration test to verify mkdir works with spaces in paths.
@leaanthony
leaanthony force-pushed the fix/darwin-mkdir-brace-expansion branch from ca66f77 to 5dbfb91 Compare January 4, 2026 04:34
@sonarqubecloud

sonarqubecloud Bot commented Jan 4, 2026

Copy link
Copy Markdown

@leaanthony
leaanthony merged commit ee7e95a into v3-alpha Jan 4, 2026
53 checks passed
@leaanthony
leaanthony deleted the fix/darwin-mkdir-brace-expansion branch January 4, 2026 04:48
Grantmartin2002 pushed a commit to Grantmartin2002/wails that referenced this pull request Apr 29, 2026
wailsapp#4850)

fix(v3): fix macOS mkdir when APP_NAME contains spaces

Replace brace expansion {MacOS,Resources} with two separate mkdir commands.
Brace expansion doesn't work inside quoted strings and is shell-dependent.

Adds integration test to verify mkdir works with spaces in paths.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant