chore: Update dotf script to include a new 'status' command
This commit is contained in:
parent
dd5bfe5bf7
commit
a831fac2ac
4
bin/actions/status.sh
Executable file
4
bin/actions/status.sh
Executable file
@ -0,0 +1,4 @@
|
||||
#!/usr/bin/env zsh
|
||||
|
||||
source ~/dotfiles/bin/helpers/functions.sh
|
||||
|
13
bin/dotf
13
bin/dotf
@ -8,6 +8,8 @@ logo() {
|
||||
println " " "cyan"
|
||||
tput sgr0
|
||||
|
||||
continue_eitherway=$1
|
||||
|
||||
# Print if repo is dirty and the count of untracked files, modified files and staged files
|
||||
if [[ $(git -C ~/dotfiles status --porcelain) ]]; then
|
||||
printfe "%s" "yellow" "dotfiles repo is dirty "
|
||||
@ -19,6 +21,9 @@ logo() {
|
||||
printfe "%s" "blue" "[$(git -C ~/dotfiles rev-parse --short HEAD)]"
|
||||
println "" "normal"
|
||||
|
||||
if [[ $continue_eitherway == "continue" ]]; then
|
||||
return
|
||||
fi
|
||||
if [[ $(git -C ~/dotfiles status --porcelain) ]]; then
|
||||
# Continue?
|
||||
printfe "%s" "red" "Continue anyway? [y/N] "
|
||||
@ -33,6 +38,10 @@ logo() {
|
||||
fi
|
||||
}
|
||||
|
||||
status() {
|
||||
~/dotfiles/bin/actions/status.sh $@
|
||||
}
|
||||
|
||||
update() {
|
||||
~/dotfiles/bin/actions/update.sh $@
|
||||
}
|
||||
@ -51,6 +60,10 @@ case $1 in
|
||||
logo
|
||||
update $@
|
||||
;;
|
||||
"status")
|
||||
logo continue
|
||||
status $@
|
||||
;;
|
||||
"export")
|
||||
logo
|
||||
exports $@
|
||||
|
Loading…
x
Reference in New Issue
Block a user