diff options
| author | Junio C Hamano <gitster@pobox.com> | 2025-05-29 09:03:01 -0700 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2025-05-29 09:03:01 -0700 |
| commit | fcfe60668e05ffde2610bfef9045797618c145ac (patch) | |
| tree | 16afb5b7ca43ab64de02c79363b80515ff259e1d /git-gui/generate-macos-wrapper.sh | |
| parent | Merge branch 'master' of https://github.com/j6t/gitk (diff) | |
| parent | Merge branch 'pks-meson-support' of github.com:pks-t/git-gui (diff) | |
| download | git-fcfe60668e05ffde2610bfef9045797618c145ac.tar.gz git-fcfe60668e05ffde2610bfef9045797618c145ac.zip | |
Merge branch 'master' of https://github.com/j6t/git-gui
* 'master' of https://github.com/j6t/git-gui:
git-gui: wire up support for the Meson build system
git-gui: stop including GIT-VERSION-FILE file
git-gui: extract script to generate macOS app
git-gui: extract script to generate macOS wrapper
git-gui: extract script to generate "tclIndex"
git-gui: extract script to generate "git-gui"
git-gui: drop no-op GITGUI_SCRIPT replacement
git-gui: make output of GIT-VERSION-GEN source'able
git-gui: prepare GIT-VERSION-GEN for out-of-tree builds
git-gui: replace GIT-GUI-VARS with GIT-GUI-BUILD-OPTIONS
Diffstat (limited to 'git-gui/generate-macos-wrapper.sh')
| -rwxr-xr-x | git-gui/generate-macos-wrapper.sh | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/git-gui/generate-macos-wrapper.sh b/git-gui/generate-macos-wrapper.sh new file mode 100755 index 0000000000..0304937f41 --- /dev/null +++ b/git-gui/generate-macos-wrapper.sh @@ -0,0 +1,35 @@ +#!/bin/sh + +set -e + +if test "$#" -ne 3 +then + echo >&2 "usage: $0 <OUTPUT> <BUILD_OPTIONS> <VERSION_FILE>" + exit 1 +fi + +OUTPUT="$1" +BUILD_OPTIONS="$2" +VERSION_FILE="$3" + +. "$BUILD_OPTIONS" + +rm -f "$OUTPUT" "$OUTPUT+" + +( + echo "#!$SHELL_PATH" + cat "$BUILD_OPTIONS" "$VERSION_FILE" + cat <<-'EOF' + if test "z$*" = zversion || + test "z$*" = z--version + then + echo "git-gui version $GITGUI_VERSION" + else + libdir="${GIT_GUI_LIB_DIR:-$GITGUI_LIBDIR}" + exec "$libdir/Git Gui.app/Contents/MacOS/$(basename "$TKEXECUTABLE")" "$0" "$@" + fi + EOF +) >"$OUTPUT+" + +chmod +x "$OUTPUT+" +mv "$OUTPUT+" "$OUTPUT" |
