Skip to content

Commit

Permalink
fix bugs in scripts on Cygwin.
Browse files Browse the repository at this point in the history
  • Loading branch information
vmi committed Mar 21, 2023
1 parent cf84fd1 commit ae17e48
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
9 changes: 8 additions & 1 deletion run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,16 @@ do_script() {
local file="$1"; shift
set -x
case "$OSTYPE" in
linux*|cygwin*)
linux*)
script -c "$*" "$file"
;;
cygwin*)
cmd=""
for a in "$@"; do
cmd="$cmd '$a'"
done
script -c "${cmd# }" "$file"
;;
darwin*|*bsd*)
script "$file" "$@"
;;
Expand Down
7 changes: 6 additions & 1 deletion tools/classpath.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,13 @@ cd "$(dirname "$0")/.."

# set classpath separator
if [ "$OSTYPE" != "cygwin" ]; then
ps="/"
sep=":"
pwd="$PWD"
else
ps='\'
sep=";"
pwd="$(cygpath -aw .)"
fi

# find MD5 sum command.
Expand All @@ -26,6 +30,7 @@ if [ -z "$md5sum" ]; then
fi

# generate classpath from pom.xml.
mkdir -p tmp
cp_conf="tmp/cp.conf"
pom_xml_md5="tmp/pom.xml.md5"
$md5sum pom.xml > "$pom_xml_md5.new"
Expand All @@ -37,4 +42,4 @@ else
mvn -Dmdep.outputFile="$cp_conf" dependency:build-classpath
mv "$pom_xml_md5.new" "$pom_xml_md5"
fi
echo "$PWD/target/classes${sep}$PWD/target/test-classes${sep}$(< "$cp_conf")"
echo "${pwd}${ps}target${ps}classes${sep}${pwd}${ps}target${ps}test-classes${sep}$(< "$cp_conf")"

0 comments on commit ae17e48

Please sign in to comment.