-
Notifications
You must be signed in to change notification settings - Fork 0
/
push.sh
executable file
·45 lines (36 loc) · 899 Bytes
/
push.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
#!/bin/bash -e
# @installable
MYSELF="$(readlink -f "$0")"
MYDIR="${MYSELF%/*}"
ME=$(basename $MYSELF)
source $MYDIR/env
[[ -f $LOCAL_ENV ]] && source $LOCAL_ENV
source $MYDIR/log.sh
source $MYDIR/db.sh
message="$1"
if [[ ! -n "$(curr_branch)" ]]; then
err "you have to be inside the repository directory"
branchd="$(db CURR_FEATURE_DIR)"
if [[ -d "$branchd" ]]; then
info "maybe you want to go to $branchd ?"
fi
exit 1
fi
name="$(db CURR_FEATURE)"
target=$(curr_branch)
if [[ ! -n "$name" ]]; then
err "you're not working on any features, make sure to start one with gclit-feature"
exit 1
fi
git checkout $name
info "${name}'s conclusion message:"
if [[ -n "$message" ]]; then
echo "$message"
else
read message
fi
info "pushing changes..."
git add .
git commit -a -m "$message" || true
git push
$MYDIR/rr-comment.sh "pushed to $name: $message"