فهرست منبع

fix bug in android script

ppwwyyxx 11 سال پیش
والد
کامیت
138ebf63ee
1فایلهای تغییر یافته به همراه4 افزوده شده و 4 حذف شده
  1. 4 4
      android-interact.sh

+ 4 - 4
android-interact.sh

@@ -1,6 +1,6 @@
 #!/bin/bash -e
 #!/bin/bash -e
 # File: android-interact.sh
 # File: android-interact.sh
-# Date: Sat Dec 27 00:04:17 2014 +0800
+# Date: Wed Dec 31 23:27:47 2014 +0800
 # Author: Yuxin Wu <[email protected]>
 # Author: Yuxin Wu <[email protected]>
 
 
 # Please check that your path is the same, since this might be different among devices
 # Please check that your path is the same, since this might be different among devices
@@ -41,15 +41,15 @@ elif [[ $1 == "db" || $1 == "res" ]]; then
 
 
 	if [[ $1 == "res" ]]; then
 	if [[ $1 == "res" ]]; then
 		echo "Pulling resources... this might take a long time..."
 		echo "Pulling resources... this might take a long time..."
-		mkdir resource; cd resource
+		mkdir -p resource; cd resource
 		for d in image2 voice2 emoji avatar; do
 		for d in image2 voice2 emoji avatar; do
-			mkdir $d; cd $d
+			mkdir -p $d; cd $d
 			adb pull $RES_DIR/$chooseUser/$d
 			adb pull $RES_DIR/$chooseUser/$d
+			cd ..
 			[[ -d $d ]] || {
 			[[ -d $d ]] || {
 				echo "Failed to download resource directory: $RES_DIR/$chooseUser/$d"
 				echo "Failed to download resource directory: $RES_DIR/$chooseUser/$d"
 				exit 1
 				exit 1
 			}
 			}
-			cd ..
 		done
 		done
 		cd ..
 		cd ..
 		echo "Resource pulled at ./resource"
 		echo "Resource pulled at ./resource"