Skip to content

fix(build): use rm -rf so a clean first build doesn't fail#539

Open
horner wants to merge 1 commit into
johnste:mainfrom
horner:fix/clean-first-build
Open

fix(build): use rm -rf so a clean first build doesn't fail#539
horner wants to merge 1 commit into
johnste:mainfrom
horner:fix/clean-first-build

Conversation

@horner

@horner horner commented Jun 28, 2026

Copy link
Copy Markdown

Problem

On a fresh checkout, running ./scripts/build.sh (local native-arch path) fails on its first run:

rm: apps/finicky/build/Finicky.app: No such file or directory

The local build path does:

build_arch arm64
rm -r apps/finicky/build/${APP_NAME}   # Finicky.app
mv apps/finicky/build/Finicky-arm64.app apps/finicky/build/${APP_NAME}

Because the script runs under set -e and apps/finicky/build/Finicky.app does not exist yet on a first build, rm -r errors out and aborts the build before the mv/asset copy. It only works once a previous build has already created the directory.

Fix

Use rm -rf so the removal is a harmless no-op when the directory doesn't exist yet. Subsequent builds are unaffected.

Testing

  • Clean checkout → ./scripts/install.sh && ./scripts/build.sh now completes with Build complete ✨ on the first run.

Summary by CodeRabbit

  • Bug Fixes
    • Made the local build cleanup step more resilient when the target build folder does not exist.
    • Prevents the build script from failing unnecessarily during native-architecture builds while keeping the same cleanup behavior when the folder is present.

On a fresh checkout there is no existing apps/finicky/build/Finicky.app, so
the 'rm -r' under 'set -e' aborts the local build on its first run. Use
'rm -rf' so the removal is a no-op when the directory doesn't yet exist.
@coderabbitai

coderabbitai Bot commented Jun 28, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: fa7c11c9-6649-4e30-b845-dd9de96f3b78

📥 Commits

Reviewing files that changed from the base of the PR and between d4d62f8 and 78b7ef9.

📒 Files selected for processing (1)
  • scripts/build.sh

📝 Walkthrough

Walkthrough

In scripts/build.sh, the local build cleanup command changes from rm -r to rm -rf, making deletion of apps/finicky/build/${APP_NAME} non-fatal when the directory is absent under set -e.

Changes

Build Script Cleanup

Layer / File(s) Summary
Non-fatal directory removal
scripts/build.sh
rm -r changed to rm -rf so the cleanup step does not fail when the target build directory is missing.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

A bunny once tripped on a path not yet made,
The -f flag arrived and came to its aid,
No directory? No problem! No error in sight,
The build hops along through the day and the night,
🐇 One flag, such relief, everything's right!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the build-script fix and the clean-first-build failure it addresses.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

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