Skip to content

Commit f89dd2d

Browse files
committed
Add modifications to support Cygwin.
I don't know while FILEDIR includes "..", so I removed it... Otherwise the changes should not affect Linux users, but please review. - Legacy-Id: 17486
1 parent 88f1166 commit f89dd2d

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

docker/run

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,17 @@ longopts=download-data,help,ietfdb-url=,mysqldata=,no-mysqldir,port=,docker-repo
7979

8080
# Default values
8181
MYSQLDIR=$parent/data/mysql
82-
FILEDIR=$parent/../data/
82+
MYSQLDIR=$(echo $MYSQLDIR | sed -e 's/^\/cygdrive\/\(.\)/\1:/')
83+
84+
#FILEDIR=$parent/../data/
85+
FILEDIR=$parent/data/
86+
8387
PORT=8000
8488
REPO="ietf/datatracker-environment"
8589
DBURL=https://www.ietf.org/lib/dt/sprint/ietf_utf8.bin.tar.bz2
8690
WHO=$(whoami)
91+
WHO=$(echo $WHO | sed -e 's/^.*\\//' | tr -d \\r)
92+
8793
WHOUID=$(id -u $WHO)
8894
WHOGID=$(id -g $WHO)
8995

@@ -120,7 +126,9 @@ while true ; do
120126
done
121127

122128
if [ -z "$TAG" ]; then
123-
TAG=$(basename $(svn info $parent | grep ^URL | awk '{print $2}'))
129+
# TAG=$(basename $(svn info $parent | grep ^URL | awk '{print $2}'))
130+
TAG=$(basename $(svn info | grep ^URL | awk '{print $2}'))
131+
TAG=$(echo $TAG | tr -d \\r)
124132
fi
125133

126134
# ----------------------------------------------------------------------
@@ -133,13 +141,17 @@ if [ "$(uname)" = "Darwin" ]; then
133141
CMD="open -a"
134142
elif [ "$(uname)" = "Linux" ]; then
135143
echo "Running on Linux."
144+
elif [ "$(uname)" = "CYGWIN_NT-10.0" ]; then
145+
echo "Running on Cygwin."
146+
HOME=$(echo $USERPROFILE | sed -e 's/\\/\//g')
147+
echo "Using home dir $HOME"
136148
else
137149
die "This script does not have support for your architecture ($(uname)); sorry :-("
138150
fi
139151

140152
if [ "$(uname)" = "Linux" ]; then
141153
echo "Not trying to start a virtual docker machine on Linux"
142-
elif [ -e "$APP" ]; then
154+
elif [ -e "$APP" -o "$(uname)" = "CYGWIN_NT-10.0" ]; then
143155
info=$(docker info 2>&1 || true)
144156
if ! docker info 1> /dev/null 2>&1; then
145157
echo -e "The docker VM doesn't seem to be running; docker info gave:\n $info"

0 commit comments

Comments
 (0)