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"
|
println " " "cyan"
|
||||||
tput sgr0
|
tput sgr0
|
||||||
|
|
||||||
|
continue_eitherway=$1
|
||||||
|
|
||||||
# Print if repo is dirty and the count of untracked files, modified files and staged files
|
# Print if repo is dirty and the count of untracked files, modified files and staged files
|
||||||
if [[ $(git -C ~/dotfiles status --porcelain) ]]; then
|
if [[ $(git -C ~/dotfiles status --porcelain) ]]; then
|
||||||
printfe "%s" "yellow" "dotfiles repo is dirty "
|
printfe "%s" "yellow" "dotfiles repo is dirty "
|
||||||
@ -19,6 +21,9 @@ logo() {
|
|||||||
printfe "%s" "blue" "[$(git -C ~/dotfiles rev-parse --short HEAD)]"
|
printfe "%s" "blue" "[$(git -C ~/dotfiles rev-parse --short HEAD)]"
|
||||||
println "" "normal"
|
println "" "normal"
|
||||||
|
|
||||||
|
if [[ $continue_eitherway == "continue" ]]; then
|
||||||
|
return
|
||||||
|
fi
|
||||||
if [[ $(git -C ~/dotfiles status --porcelain) ]]; then
|
if [[ $(git -C ~/dotfiles status --porcelain) ]]; then
|
||||||
# Continue?
|
# Continue?
|
||||||
printfe "%s" "red" "Continue anyway? [y/N] "
|
printfe "%s" "red" "Continue anyway? [y/N] "
|
||||||
@ -33,6 +38,10 @@ logo() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
status() {
|
||||||
|
~/dotfiles/bin/actions/status.sh $@
|
||||||
|
}
|
||||||
|
|
||||||
update() {
|
update() {
|
||||||
~/dotfiles/bin/actions/update.sh $@
|
~/dotfiles/bin/actions/update.sh $@
|
||||||
}
|
}
|
||||||
@ -51,6 +60,10 @@ case $1 in
|
|||||||
logo
|
logo
|
||||||
update $@
|
update $@
|
||||||
;;
|
;;
|
||||||
|
"status")
|
||||||
|
logo continue
|
||||||
|
status $@
|
||||||
|
;;
|
||||||
"export")
|
"export")
|
||||||
logo
|
logo
|
||||||
exports $@
|
exports $@
|
||||||
|
Loading…
x
Reference in New Issue
Block a user