Permalink
Browse files

Generate MSYSGITROOT relative to the running script's directory

It might be useful to have SCRIPTDIR. Also, add MSYSGITROOT at the
remaining required places.

Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
  • Loading branch information...
1 parent d434031 commit 42a6098c0151ea20ff1a405e448f15866ac31dca @sschuberth sschuberth committed Apr 29, 2011
Showing with 10 additions and 6 deletions.
  1. +3 −2 share/WinGit/copy-files.sh
  2. +3 −2 share/WinGit/portable-release.sh
  3. +4 −2 share/WinGit/release.sh
@@ -25,16 +25,17 @@ then
}
fi
+SCRIPTDIR="$(cd "$(dirname "$0")" && pwd)"
+MSYSGITROOT="$(cd $SCRIPTDIR/../../ && pwd | sed 's/\/$//')/."
TMPDIR=$1
(test ! -d "$TMPDIR" || echo "Removing $TMPDIR" && rm -rf "$TMPDIR") &&
-MSYSGITROOT="$(echo $(pwd) | sed 's/\/$//')/." &&
mkdir "$TMPDIR" &&
cd "$TMPDIR" &&
echo "Copying files" &&
(git --git-dir=$MSYSGITROOT/doc/git/html/.git log --pretty=format:%s -1 HEAD &&
mkdir -p doc/git/html && cd doc/git/html &&
- git --git-dir=/doc/git/html/.git archive HEAD | tar xf -) &&
+ git --git-dir=$MSYSGITROOT/doc/git/html/.git archive HEAD | tar xf -) &&
(cd $MSYSGITROOT && tar cf - \
$(ls {bin,libexec/git-core}/git* | grep -v 'cvs\|shell\|archimport\|instaweb') \
bin/{antiword.exe,astextplain,awk,basename.exe,bash.exe,bison.exe,yacc,\
@@ -6,11 +6,12 @@ test -z "$1" && {
}
# change directory to msysGit root
-cd "$(dirname "$0")"/../.. || {
+SCRIPTDIR="$(cd "$(dirname "$0")" && pwd)"
+MSYSGITROOT="$(cd $SCRIPTDIR/../../ && pwd | sed 's/\/$//')/."
+cd $MSYSGITROOT || {
echo "Could not change directory to msysGit root" >&2
exit 1
}
-MSYSGITROOT="$(echo $(pwd) | sed 's/\/$//')/."
TARGET="$HOME"/PortableGit-$1.7z
OPTS7="-m0=lzma -mx=9 -md=64M"
View
@@ -26,7 +26,9 @@ test -z "$1" && {
version=$1
# change directory to msysGit root
-cd "$(dirname "$0")"/../.. || {
+SCRIPTDIR="$(cd "$(dirname "$0")" && pwd)"
+MSYSGITROOT="$(cd $SCRIPTDIR/../../ && pwd | sed 's/\/$//')/."
+cd $MSYSGITROOT || {
echo "Could not change directory to msysGit root" >&2
exit 1
}
@@ -124,7 +126,7 @@ test -z "$force" && {
TMPDIR=/tmp/WinGit
unset DONT_REMOVE_BUILTINS
-share/WinGit/copy-files.sh $TMPDIR &&
+$MSYSGITROOT/share/WinGit/copy-files.sh $TMPDIR &&
sed -e '/share\/msysGit/d' -e "s/msysGit/Git (version $version)/" \
< etc/motd > $TMPDIR/etc/motd &&
cp share/resources/gpl-2.0.rtf share/resources/git.bmp share/resources/gitsmall.bmp $TMPDIR &&

0 comments on commit 42a6098

Please sign in to comment.