This repository was archived by the owner on Nov 9, 2017. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +48
-0
lines changed Expand file tree Collapse file tree 1 file changed +48
-0
lines changed Original file line number Diff line number Diff line change 1
1
#! /bin/sh
2
2
3
+ # Fix some commands on Windows
4
+ case $( uname -s) in
5
+ * MINGW* )
6
+ winpath () {
7
+ # pwd -W is the only way of getting msys to convert the path, especially mounted paths like /usr
8
+ # since cmd /c only takes a single parameter preventing msys automatic path conversion.
9
+ if test " ${1: ~-1: 1} " ! = " /" ; then
10
+ echo " $1 " | sed ' s+/+\\+g'
11
+ elif test -d " $1 " ; then
12
+ (cd " $1 " ; pwd -W) | sed ' s+/+\\+g'
13
+ elif test -d " ${1%/* } " ; then
14
+ (cd " ${1%/* } " ; echo " $( pwd -W) /${1##*/ } " ) | sed ' s+/+\\+g'
15
+ else
16
+ echo " $1 " | sed -e ' s+^/\([a-z]\)/+\1:/+' -e ' s+/+\\+g'
17
+ fi
18
+ }
19
+ # git sees Windows-style pwd
20
+ pwd () {
21
+ builtin pwd -W
22
+ }
23
+ # use mklink
24
+ ln () {
25
+
26
+ ln_sym_hard=/H
27
+ ln_sym_dir=
28
+ if test " $1 " = " -s"
29
+ then
30
+ ln_sym_hard=
31
+ shift
32
+ fi
33
+ pushd $( dirname " $2 " ) 2>&1 > /dev/null
34
+ builtin test -d " $1 " && ln_sym_dir=/D
35
+ popd > /dev/null 2> /dev/null
36
+ cmd /c " mklink ${ln_sym_hard}${ln_sym_dir} \" $( winpath " $2 " ) \" \" $( winpath " $1 " ) \" >/dev/null " 2> /dev/null
37
+ }
38
+
39
+ test () {
40
+ case " $1 " in
41
+ -h)
42
+ test_file=$( cmd /c " @dir /b/a:l \" $( winpath " ${2} " ) \" 2> nul" )
43
+ builtin test -n " ${test_file} "
44
+ ;;
45
+ * ) builtin test " $@ " ;;
46
+ esac
47
+ }
48
+ esac
49
+
3
50
usage () {
4
51
echo " usage:" $@
5
52
exit 127
70
117
mkdir -p " $( dirname " $new_workdir /.git/$x " ) "
71
118
;;
72
119
esac
120
+ test -e " $git_dir /$x " || mkdir " $git_dir /$x "
73
121
ln -s " $git_dir /$x " " $new_workdir /.git/$x "
74
122
done
75
123
You can’t perform that action at this time.
0 commit comments