--- a/nashorn/bin/fixwhitespace.sh Tue May 27 21:25:07 2014 +0200
+++ b/nashorn/bin/fixwhitespace.sh Wed May 28 13:58:46 2014 +0200
@@ -22,15 +22,16 @@
# questions.
#
-#convert tabs to spaces
-find . -name "*.java" -exec sed -i "" 's/ / /g' {} \;
-
-#remove trailing whitespace
-find . -name "*.java" -exec sed -i "" 's/[ ]*$//' \{} \;
+fix() {
+ #convert tabs to spaces
+ find . -name $1 -exec sed -i "" 's/ / /g' {} \;
+ #remove trailing whitespace
+ find . -name $1 -exec sed -i "" 's/[ ]*$//' \{} \;
+}
-#convert tabs to spaces
-find . -name "*.js" -exec sed -i "" 's/ / /g' {} \;
-
-#remove trailing whitespace
-find . -name "*.js" -exec sed -i "" 's/[ ]*$//' \{} \;
-
+if [ ! -z $1 ]; then
+ fix $1;
+else
+ fix "*.java"
+ fix "*.js"
+fi