Selaa lähdekoodia

Merge pull request #24 from xrf/compatibility

Allow android-interact.sh to be run in another directory
Yuxin Wu 10 vuotta sitten
vanhempi
sitoutus
1e5f15f506
2 muutettua tiedostoa jossa 3 lisäystä ja 9 poistoa
  1. 3 3
      android-interact.sh
  2. 0 6
      compatibility.sh

+ 3 - 3
android-interact.sh

@@ -3,12 +3,12 @@
 # Date: Fri Jun 26 10:38:07 2015 +0800
 # Author: Yuxin Wu <[email protected]>
 
-source compatibility.sh
-
-PROG_NAME=`$REALPATH "$0"`
+PROG_NAME=`python -c "import os, sys; print(os.path.realpath(sys.argv[1]))" "$0"`
 PROG_DIR=`dirname "$PROG_NAME"`
 cd "$PROG_DIR"
 
+source compatibility.sh
+
 # Please check that your path is the same, since this might be different among devices
 RES_DIR="/mnt/sdcard/tencent/MicroMsg"
 MM_DIR="/data/data/com.tencent.mm"

+ 0 - 6
compatibility.sh

@@ -3,16 +3,10 @@
 # $Date: Tue Jun 16 22:23:36 2015 +0800
 # Author: Vury Leo <i[at]vuryleo[dot]com>
 
-realpath() {
-  [[ $1 = /* ]] && echo "$1" || echo "$PWD/${1#./}"
-}
-
 if [ `uname` = 'Darwin' ]; then
-  REALPATH='realpath'
   GREP='grep -E'
   MD5SUM='md5'
 else
-  REALPATH='readlink -f'
   GREP='grep -E'
   MD5SUM='md5sum'
 fi