feat(git): remove commit subcommand & accept list of files for default behavior
This commit is contained in:
parent
7140ca55e0
commit
b5ced0b7ec
3 changed files with 18 additions and 18 deletions
|
@ -1,4 +1,4 @@
|
||||||
# Scripts
|
# Ayo's Scripts
|
||||||
|
|
||||||
Personal BASH scripts for productivity
|
Personal BASH scripts for productivity
|
||||||
|
|
||||||
|
@ -25,10 +25,9 @@ $ vim ~/ayo.conf
|
||||||
1. journal - creates a new journal entry if it doesn’t exist yet; opens on editor
|
1. journal - creates a new journal entry if it doesn’t exist yet; opens on editor
|
||||||
1. append - append one thought at the end of the day's entry
|
1. append - append one thought at the end of the day's entry
|
||||||
1. notes - notes management
|
1. notes - notes management
|
||||||
1. git (g) - git tools; default behavior is gs, gc, then gp ...
|
1. git (g) - args can be list of files to commit & push
|
||||||
1. stat (gs) - git status
|
1. stat (gs) - git status
|
||||||
2. commit (gc) - git commit (reads for message, accepts args as list of files to commit)
|
1. push (gp) - git push
|
||||||
3. push (gp) - git push
|
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
1. Autosync for notes & journal via git
|
1. Autosync for notes & journal via git
|
||||||
|
|
13
ayo.sh
13
ayo.sh
|
@ -3,22 +3,19 @@
|
||||||
case $1 in
|
case $1 in
|
||||||
## SHORTCUTS
|
## SHORTCUTS
|
||||||
|
|
||||||
ja) # js - journal append
|
ja) # journal append
|
||||||
. ${HOME}/Projects/scripts/journal.sh append $2 $3 $4 $5 $6 $7 $8 $9
|
. ${HOME}/Projects/scripts/journal.sh append $2 $3 $4 $5 $6 $7 $8 $9
|
||||||
;;
|
;;
|
||||||
js) # js - journal sync
|
js) # journal sync (same as ns)
|
||||||
. ${HOME}/Projects/scripts/journal.sh sync $2 $3 $4 $5 $6 $7 $8 $9
|
. ${HOME}/Projects/scripts/journal.sh sync $2 $3 $4 $5 $6 $7 $8 $9
|
||||||
;;
|
;;
|
||||||
ns) # js - journal sync
|
ns) # notes sync
|
||||||
. ${HOME}/Projects/scripts/notes.sh sync $2 $3 $4 $5 $6 $7 $8 $9
|
. ${HOME}/Projects/scripts/notes.sh sync $2 $3 $4 $5 $6 $7 $8 $9
|
||||||
;;
|
;;
|
||||||
gs) # js - journal sync
|
gs) # git status
|
||||||
. ${HOME}/Projects/scripts/git.sh stat $2 $3 $4 $5 $6 $7 $8 $9
|
. ${HOME}/Projects/scripts/git.sh stat $2 $3 $4 $5 $6 $7 $8 $9
|
||||||
;;
|
;;
|
||||||
gc) # js - journal sync
|
gp) # git push
|
||||||
. ${HOME}/Projects/scripts/git.sh commit $2 $3 $4 $5 $6 $7 $8 $9
|
|
||||||
;;
|
|
||||||
gp) # js - journal sync
|
|
||||||
. ${HOME}/Projects/scripts/git.sh push $2 $3 $4 $5 $6 $7 $8 $9
|
. ${HOME}/Projects/scripts/git.sh push $2 $3 $4 $5 $6 $7 $8 $9
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
|
16
git.sh
16
git.sh
|
@ -21,7 +21,6 @@ gitStatus() {
|
||||||
|
|
||||||
gitCommit() {
|
gitCommit() {
|
||||||
{
|
{
|
||||||
echo "gitCommit called"
|
|
||||||
git add .
|
git add .
|
||||||
read -p "Message: " message
|
read -p "Message: " message
|
||||||
git commit -m "$message" $*
|
git commit -m "$message" $*
|
||||||
|
@ -42,15 +41,20 @@ gitPush() {
|
||||||
|
|
||||||
if [ "$1" = "stat" ]; then
|
if [ "$1" = "stat" ]; then
|
||||||
gitStatus
|
gitStatus
|
||||||
elif [ "$1" = "commit" ]; then
|
|
||||||
gitCommit
|
|
||||||
elif [ "$1" = "push" ]; then
|
elif [ "$1" = "push" ]; then
|
||||||
gitPush
|
gitPush
|
||||||
else
|
else
|
||||||
gitStatus
|
echo ">>> $1"
|
||||||
if ! [ "$1" = "g" ]; then
|
if [ "$1" = "g" ] || [ "$1" = "git" ]; then
|
||||||
|
git reset HEAD -- .
|
||||||
|
git add .
|
||||||
|
git status
|
||||||
|
gitCommit
|
||||||
|
else
|
||||||
|
git reset HEAD -- .
|
||||||
|
git add $*
|
||||||
|
git status
|
||||||
gitCommit $*
|
gitCommit $*
|
||||||
fi
|
fi
|
||||||
gitCommit
|
|
||||||
gitPush
|
gitPush
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in a new issue