Hopefully the final batch before 2.48-rc1
[git/gitster.git] / generate-script.sh
bloba149e4f0ba348e62b963a2a95e1b250e8732fc20
1 #!/bin/sh
3 set -e
5 if test $# -ne 3
6 then
7 echo >&2 "USAGE: $0 <INPUT> <OUTPUT> <GIT-BUILD-OPTIONS>"
8 exit 1
9 fi
11 INPUT="$1"
12 OUTPUT="$2"
13 BUILD_OPTIONS="$3"
15 . "$BUILD_OPTIONS"
17 sed -e "1s|#!.*/sh|#!$SHELL_PATH|" \
18 -e "s|@SHELL_PATH@|$SHELL_PATH|" \
19 -e "s|@DIFF@|$DIFF|" \
20 -e "s|@LOCALEDIR@|$LOCALEDIR|g" \
21 -e "s/@USE_GETTEXT_SCHEME@/$USE_GETTEXT_SCHEME/g" \
22 -e "$BROKEN_PATH_FIX" \
23 -e "s|@GITWEBDIR@|$GITWEBDIR|g" \
24 -e "s|@PERL_PATH@|$PERL_PATH|g" \
25 -e "s|@PAGER_ENV@|$PAGER_ENV|g" \
26 "$INPUT" >"$OUTPUT"
28 case "$(basename "$INPUT")" in
29 git-mergetool--lib.sh|git-sh-i18n.sh|git-sh-setup.sh)
32 chmod a+x "$OUTPUT"
34 esac