Home | History | Annotate | Download | only in quake
      1 #!/bin/bash
      2 #
      3 # Copy Quake's data files from perforce to the Android device's sd card.
      4 # Based on emulator.sh
      5 #
      6 
      7 # We need some internal functions defined in envsetup.sh, so start
      8 # by finding this file and sourcing it before anything else
      9 #
     10 function gettop
     11 {
     12     TOPFILE=config/envsetup.make
     13     if [ -n "$TOP" -a -f "$TOP/$TOPFILE" ] ; then
     14         echo $TOP
     15     else
     16         if [ -f $TOPFILE ] ; then
     17             echo $PWD
     18         else
     19             HERE=$PWD
     20             T=
     21             while [ \( ! \( -f $TOPFILE \) \) -a \( $PWD != "/" \) ]; do
     22                 cd ..
     23                 T=$PWD
     24             done
     25             cd $HERE
     26             if [ -f "$T/$TOPFILE" ]; then
     27                 echo $T
     28             fi
     29         fi
     30     fi
     31 }
     32 
     33 T=$(gettop)
     34 if [ -z "$T" ] ; then
     35     echo "please run your envsetup.sh script"
     36     exit 1
     37 fi
     38 
     39 echo "top found at $T"
     40 
     41 echo "Removing Quake files and directories from the device's sdcard"
     42 
     43 adb shell rm /sdcard/data/quake/id1/glQuake/*
     44 adb shell rm /sdcard/data/quake/id1/glQuake/.DS_Store
     45 adb shell rmdir /sdcard/data/quake/glQuake
     46 adb shell rm /sdcard/data/quake/id1/*
     47 adb shell rm /sdcard/data/quake/id1/.DS_Store
     48 adb shell rmdir /sdcard/data/quake/id1
     49 adb shell rm /sdcard/data/quake/.DS_Store
     50 adb shell rmdir /sdcard/data/quake
     51 
     52 echo "Done."