blob: 3c5fbec5eb2c8285160c24f23fd75cd16b311b24 [file] [log] [blame]
Jack Palevichcabb5dd2009-04-29 11:58:17 -07001#!/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#
10function 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
33T=$(gettop)
34if [ -z "$T" ] ; then
35 echo "please run your envsetup.sh script"
36 exit 1
37fi
38
39echo "top found at $T"
40
41echo "Removing Quake files and directories from the device's sdcard"
42
43adb shell rm /sdcard/data/quake/id1/glQuake/*
44adb shell rm /sdcard/data/quake/id1/glQuake/.DS_Store
45adb shell rmdir /sdcard/data/quake/glQuake
46adb shell rm /sdcard/data/quake/id1/*
47adb shell rm /sdcard/data/quake/id1/.DS_Store
48adb shell rmdir /sdcard/data/quake/id1
49adb shell rm /sdcard/data/quake/.DS_Store
50adb shell rmdir /sdcard/data/quake
51
52echo "Done."