aboutsummaryrefslogtreecommitdiffstats
path: root/eclipse/scripts
diff options
context:
space:
mode:
authorRaphael Moll <ralf@android.com>2011-01-27 22:23:50 -0800
committerRaphael Moll <ralf@android.com>2011-01-27 22:24:17 -0800
commit92f5faa37090d1c7d46af26559e54423954c93f7 (patch)
tree246a878cdb6beea3499d121392839e1fbf3061d0 /eclipse/scripts
parentb9a1520efea19edd664466361fa28b31cf4d38b6 (diff)
downloadsdk-92f5faa37090d1c7d46af26559e54423954c93f7.zip
sdk-92f5faa37090d1c7d46af26559e54423954c93f7.tar.gz
sdk-92f5faa37090d1c7d46af26559e54423954c93f7.tar.bz2
Fix clean script.
The way bash works, the script returns the status of the last command. In this case, the last failed test's return value is what the script returns, even when that's what we want. Encapsulating the test in a function works around this. Change-Id: I44de75d80b2d16ca4110f078d40db0f71f1aa400
Diffstat (limited to 'eclipse/scripts')
-rwxr-xr-xeclipse/scripts/create_test_symlinks.sh16
1 files changed, 11 insertions, 5 deletions
diff --git a/eclipse/scripts/create_test_symlinks.sh b/eclipse/scripts/create_test_symlinks.sh
index 83651a3..eb41f5e 100755
--- a/eclipse/scripts/create_test_symlinks.sh
+++ b/eclipse/scripts/create_test_symlinks.sh
@@ -70,12 +70,18 @@ fi
# Cleanup old obsolete symlink
+function clean() {
+ if [[ -e "$1" || -L "$1" ]]; then
+ rm -rfv "$1"
+ fi
+}
+
DEST=$BASE/unittests/com/android
-[[ -e $DEST/sdkuilib || -L $DEST/sdkuilib ]] && rm -rfv $DEST/sdkuilib
-[[ -e $DEST/ddmlib || -L $DEST/ddmlib ]] && rm -rfv $DEST/ddmlib
-[[ -e $DEST/sdklib || -L $DEST/sdklib ]] && rm -rfv $DEST/sdklib
+clean $DEST/sdkuilib
+clean $DEST/ddmlib
+clean $DEST/sdklib
DEST=$BASE/unittests/com/android/layoutlib
-[[ -e $DEST/bridge || -L $DEST/bridge ]] && rm -rfv $DEST/bridge
-[[ -e $DEST/testdata || -L $DEST/testdata ]] && rm -rfv $DEST/testdata
+clean $DEST/bridge
+clean $DEST/testdata