mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-16 15:41:16 +01:00
script to ... fetch screenshots
This commit is contained in:
parent
69e050c8de
commit
6a6e5b2f4f
1 changed files with 49 additions and 0 deletions
49
xwords4/android/scripts/fetch-screenshots.sh
Executable file
49
xwords4/android/scripts/fetch-screenshots.sh
Executable file
|
@ -0,0 +1,49 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -e -u
|
||||
|
||||
LIST=""
|
||||
ALL=""
|
||||
FILE=""
|
||||
DIR="/sdcard/Pictures/Screenshots"
|
||||
WD=$(pwd)
|
||||
|
||||
usage() {
|
||||
[ $# -ge 1 ] && echo "Error: $1"
|
||||
echo "usage: $0 --help | --list | <name.png>"
|
||||
exit 1
|
||||
}
|
||||
|
||||
pullFile() {
|
||||
echo "pulling $1"
|
||||
adb pull ${DIR}/$1 ${WD}/
|
||||
}
|
||||
|
||||
[ $# -eq 1 ] || usage "Requires a single parameter"
|
||||
|
||||
while [ $# -ge 1 ]; do
|
||||
echo $1
|
||||
case $1 in
|
||||
--list)
|
||||
LIST=1
|
||||
;;
|
||||
--help)
|
||||
usage
|
||||
;;
|
||||
*)
|
||||
FILE=$1
|
||||
;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
SHOTS=$(adb shell "ls $DIR")
|
||||
|
||||
if [ -n "$FILE" ]; then
|
||||
pullFile ${FILE}
|
||||
elif [ -n "$LIST" ]; then
|
||||
for SHOT in $SHOTS; do
|
||||
echo $SHOT
|
||||
done
|
||||
fi
|
||||
|
Loading…
Reference in a new issue