summaryrefslogtreecommitdiff
path: root/tools/cpof
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2012-06-03 13:54:06 -0700
committerPaul Phillips <paulp@improving.org>2012-06-06 14:23:44 -0700
commita43e070e232ce35ef14fce34458ee3ea6e823078 (patch)
tree5d679372f53b6e650d81d87c4e0bd654ed9051c3 /tools/cpof
parent6cdb6b0299cb917ac3df9e39aa932bacdc31faf9 (diff)
downloadscala-a43e070e232ce35ef14fce34458ee3ea6e823078.tar.gz
scala-a43e070e232ce35ef14fce34458ee3ea6e823078.tar.bz2
scala-a43e070e232ce35ef14fce34458ee3ea6e823078.zip
Updated tools/*cp scripts.
To include the asm classes in some cases, and also to improve with my sadly now-greater knowledge of shell scripting.
Diffstat (limited to 'tools/cpof')
-rwxr-xr-xtools/cpof28
1 files changed, 8 insertions, 20 deletions
diff --git a/tools/cpof b/tools/cpof
index ab5a42b4fb..c09ed20d69 100755
--- a/tools/cpof
+++ b/tools/cpof
@@ -3,28 +3,16 @@
# Creates a classpath out of the contents of each directory
# given as an argument.
-if [ $# == 0 ] ; then
- echo "Usage: $0 [dir1 dir2 ...]"
- exit 1
-fi
+[[ $# == 0 ]] && { echo "Usage: $0 [dir1 dir2 ...]" && exit 0; }
-THISDIR=`dirname $0`
-ABSCMD="${THISDIR}/abspath"
-CPRES=""
+sdir=$(dirname $0)
+cp=""
-for dir in $* ; do
- absdir=`${ABSCMD} $dir`
- LS=`ls -1 ${absdir}`
-
- for x in $LS ; do
- ABS=`${ABSCMD} "${absdir}/${x}"`
- CPRES="${CPRES}:${ABS}"
+for dir in "$@" ; do
+ for x in $($sdir/abspath $dir)/* ; do
+ cp="$cp:$($sdir/abspath $x)"
done
done
-# shaving the : off the beginning. Applause to /bin/sh for
-# keeping us humble about how far we've come.
-LEN=$(( ${#CPRES} - 1 ))
-result=${CPRES:1:${LEN}}
-
-echo $result
+# shaving the : off the beginning.
+echo ${cp#:}