homepath
This commit is contained in:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user