-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgit_add_push_develop.sh
executable file
·74 lines (59 loc) · 1.15 KB
/
git_add_push_develop.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
#!/bin/zsh
# TODO
# DEPRECATED (21-July-2023) - SEE Rscripts. Keep only as shell script example.
# -
# Wed 11Jan2023
# - include built in arry of directories to ALWAYS run.
# - if arg1 is "." (current dir) expand to FULL PATH
# - to uppper DIRECTORY
# - suppress git output, unless ERROR
# - catch git ERROR, and put into IF
#
#
# PURPOSE: Automate git add, git push for given REPO.
# USAGE:
# - for specified directory, performs git push
#
# define function
#
# 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 ${PWD}
echo "\n"
echo "$(date)"
#echo "BEGIN ...... ${1} ... ${PWD}"
#echo "\n"
#echo "STATUS ......\n"
#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