-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathadb_push_mp3_device.sh
80 lines (58 loc) · 1.04 KB
/
adb_push_mp3_device.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#!/bin/zsh
# PURPOSE: adb push * /sdcard/Music
# push files to device AND keep log (should push fail)
# TODO
#
#
# USAGE:
# If adb error: CHECK:
# less ~/adb_push_mp3_device_LOG.log and then search `error`
#
#
#
# from directory with mp3 files (`~/mp3_files`)
cd ~/mp3_files
adb push * /sdcard/Music | tee > ~/adb_push_mp3_device_LOG.log
exit
#---------
# LEGACY
#---------
# returns true or false
has_arg() {
test -n "$1"
}
#
add_commit_push()
{
if has_arg "$1"
then
else echo "** problem ** "
echo "USAGE: must have arg <dir>"
exit
fi
cd $1
# Add files, Commit, Push
line="==========================="
echo "\n"
echo $line
echo $(date)
echo ".... BEGIN ... ${1} ... ${PWD}"
#echo "\n"
echo "....STATUS ..."
git s
#echo "\n"
echo "....ADD FILES ..."
git a
#echo "\n"
echo "....COMMIT ..."
git cm wip
#echo "\n"
echo "....PUSH ..."
git push
#echo "\n"
echo "....FINAL STATUS ..."
git s
echo $line
}
# run function, using directory specified as arg 1
add_commit_push $1