diff --git a/README.md b/README.md index 0170fbd..dda61e1 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Scripts +# Ayo's Scripts 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. append - append one thought at the end of the day's entry 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 - 2. commit (gc) - git commit (reads for message, accepts args as list of files to commit) - 3. push (gp) - git push + 1. push (gp) - git push ## Features 1. Autosync for notes & journal via git diff --git a/ayo.sh b/ayo.sh index 207fdcb..2822937 100755 --- a/ayo.sh +++ b/ayo.sh @@ -3,22 +3,19 @@ case $1 in ## SHORTCUTS - ja) # js - journal append + ja) # journal append . ${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 ;; - ns) # js - journal sync + ns) # notes sync . ${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 ;; - gc) # js - journal sync - . ${HOME}/Projects/scripts/git.sh commit $2 $3 $4 $5 $6 $7 $8 $9 - ;; - gp) # js - journal sync + gp) # git push . ${HOME}/Projects/scripts/git.sh push $2 $3 $4 $5 $6 $7 $8 $9 ;; diff --git a/git.sh b/git.sh index 943302a..d9977be 100755 --- a/git.sh +++ b/git.sh @@ -21,7 +21,6 @@ gitStatus() { gitCommit() { { - echo "gitCommit called" git add . read -p "Message: " message git commit -m "$message" $* @@ -42,15 +41,20 @@ gitPush() { if [ "$1" = "stat" ]; then gitStatus -elif [ "$1" = "commit" ]; then - gitCommit elif [ "$1" = "push" ]; then gitPush else - gitStatus - if ! [ "$1" = "g" ]; then + echo ">>> $1" + if [ "$1" = "g" ] || [ "$1" = "git" ]; then + git reset HEAD -- . + git add . + git status + gitCommit + else + git reset HEAD -- . + git add $* + git status gitCommit $* fi - gitCommit gitPush fi