diff --git a/__mac-cluade-app-builder/make-app.sh b/__mac-cluade-app-builder/make-app.sh index 45b1157..29d5d3f 100755 --- a/__mac-cluade-app-builder/make-app.sh +++ b/__mac-cluade-app-builder/make-app.sh @@ -65,8 +65,15 @@ if [[ ! -f "$BIN" ]]; then swift build -c release fi -# expand ~ in workdir -WORKDIR="${WORKDIR/#\~/$HOME}" +# Keep workdir portable across machines/users: store paths under the current +# home directory as a literal "~", so each app expands it per-user at runtime +# (Swift's expandingTildeInPath). Note the shell may have already expanded a "~" +# you typed on the command line into an absolute $HOME path, so we normalize that +# back to "~" too. Paths outside $HOME stay absolute (genuinely machine-specific). +case "$WORKDIR" in + "$HOME") WORKDIR="~" ;; + "$HOME"/*) WORKDIR="~/${WORKDIR#"$HOME"/}" ;; +esac # ---- assemble the .app bundle --------------------------------------------- APP="$OUTDIR/$NAME.app"