From 059e07c30eab966382a9dfd49787b09a3d611bc1 Mon Sep 17 00:00:00 2001 From: marcusH Date: Sun, 14 Jun 2026 12:35:47 +0200 Subject: [PATCH] homepath --- __mac-cluade-app-builder/make-app.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) 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"