Fix building the CWD variable
[msysgit.git] / share / WinGit / portable-release.sh
blobce991a362d8477aaf42cf1c78785a64c24c5f497
1 #!/bin/sh
3 test -z "$1" && {
4 echo "Usage: $0 <version>"
5 exit 1
8 # change directory to msysGit root
9 cd "$(dirname "$0")"/../.. || {
10 echo "Could not change directory to msysGit root" >&2
11 exit 1
13 CWD="$(echo $(pwd) | sed 's/\/$//')/."
15 TARGET="$HOME"/PortableGit-$1.7z
16 OPTS7="-m0=lzma -mx=9 -md=64M"
17 TARGET7=tmp.7z
18 TMPDIR=/tmp/WinGit
20 DONT_REMOVE_BUILTINS=1 "$(dirname $0)/copy-files.sh" $TMPDIR &&
21 cd "$TMPDIR" &&
22 cp $CWD/share/WinGit/README.portable ./ &&
23 cp $CWD/msys.bat ./git-bash.bat &&
24 cp $CWD/git-cmd.bat ./ &&
25 $CWD/share/7-Zip/7za.exe a $OPTS7 $TARGET7 * ||
26 exit
28 if test -z "$NO_SFX"
29 then
30 (cat $CWD/share/7-Zip/7zSD.sfx &&
31 echo ';!@Install@!UTF-8!' &&
32 echo 'Progress="yes"' &&
33 echo 'Title="WinGit: MinGW Git + minimal MSys installation"' &&
34 echo 'BeginPrompt="This program installs a complete Git for MSys setup"' &&
35 echo 'CancelPrompt="Do you want to cancel WinGit installation?"' &&
36 echo 'ExtractDialogText="Please, wait..."' &&
37 echo 'ExtractPathText="Where do you want to install WinGit?"' &&
38 echo 'ExtractTitle="Extracting..."' &&
39 echo 'GUIFlags="8+32+64+256+4096"' &&
40 echo 'GUIMode="1"' &&
41 echo 'InstallPath="%PROGRAMFILES%\\Git"' &&
42 echo 'OverwriteMode="0"' &&
43 echo ';!@InstallEnd@!7z' &&
44 cat $TARGET7) > "$TARGET"
45 else
46 mv $TARGET7 > "$TARGET"
47 fi &&
48 echo "Created $TARGET"