Skip to content

Commit 18bdb4d

Browse files
committed
Changes for new 2.1.0.1 release and to work with Cygwin.
1 parent a45a134 commit 18bdb4d

File tree

3 files changed

+19
-8
lines changed

3 files changed

+19
-8
lines changed

src/examples/scripts/findjar.sh

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,13 @@ PROG=${0##*/}
1010
# Default starting directory is Maven2 repository under $HOME ...
1111
starting_dir=$HOME/.m2/repository
1212

13+
# If we are on Cygwin on Windows, the Maven repo may be under $USERPROFILE.
14+
if [[ $(uname -o) == "Cygwin" && ! -d "$starting_dir" ]]
15+
then starting_dir="$(cygpath --unix ${USERPROFILE:-$HOME}/.m2/repository)"
16+
fi
17+
1318
case "$1" in
14-
-start) shift; starting_dir="$1"; shift ;;
19+
-start) shift; starting_dir="$1"; shift ;; # Expected to be right if provided
1520
-\?) echo "$USAGE" >&2; exit 2 ;;
1621
-*) echo "$PROG: Unknown option: $1; treating as a jar pattern." >&2 ;;
1722
esac
@@ -25,5 +30,11 @@ esac
2530

2631
# echo "Starting location: $starting_dir" # DEBUG
2732
# echo "Jar pattern: $jar_pattern" # DEBUG
28-
find "$starting_dir" -type f -name "$jar_pattern" -print |
29-
egrep -v 'javadoc|sources'
33+
if [[ -d "$starting_dir" ]]
34+
then
35+
find "$starting_dir" -type f -name "$jar_pattern" -print |
36+
egrep -v 'javadoc|sources'
37+
else
38+
echo "$PROG: Can't find starting directory for Maven repo: $starting_dir" >&2
39+
exit 1
40+
fi

src/examples/scripts/setenv-svn.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#/bin/bash
22
# Purpose: Use to set up environment to compile and run examples if ESAPI
3-
# downloaded from the SVN repository.
3+
# downloaded from the Svn or Git repository.
44
# Usage: From csh, tcsh:
55
# $ source ./setenv-svn.sh
66
# From most other *nix shells:
@@ -18,9 +18,9 @@
1818
esapi_classpath=".:\
1919
../../../target/classes:\
2020
$(ls ../../../target/esapi-*.jar 2>&- || echo .):\
21-
$(./findjar.sh log4j-1.2.16.jar):\
22-
$(./findjar.sh commons-fileupload-1.2.jar):\
23-
$(./findjar.sh servlet-api-2.4.jar)"
21+
$(./findjar.sh log4j-1.2.17.jar):\
22+
$(./findjar.sh commons-fileupload-1.3.1.jar):\
23+
$(./findjar.sh servlet-api-2.5.jar)"
2424

2525
esapi_resources="$(\cd ../../../configuration/esapi >&- 2>&- && pwd)"
2626
esapi_resources_test="$(\cd ../../../src/test/resources/esapi >&- 2>&- && pwd)"

src/examples/scripts/setenv-zip.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# since the specific version of the library is delivered as part of the
1414
# ESAPI zip file. In this manner, we do not have to update this if these
1515
# versions change. For the record, at the time of this writing, these were
16-
# log4j-1.2.16.jar, commons-fileupload-1.2.jar, and servlet-api-2.4.jar.
16+
# log4j-1.2.17.jar, commons-fileupload-1.3.1.jar, and servlet-api-2.5.jar.
1717
esapi_classpath=".:\
1818
$(ls ../../../esapi*.jar):\
1919
$(./findjar.sh -start ../../../libs log4j-*.jar):\

0 commit comments

Comments
 (0)