From a831fac2ac5c868d6d518f6fa33dd93c4c81716b Mon Sep 17 00:00:00 2001 From: Menno van Leeuwen Date: Thu, 22 Aug 2024 16:16:40 +0200 Subject: [PATCH] chore: Update dotf script to include a new 'status' command --- bin/actions/status.sh | 4 ++++ bin/dotf | 13 +++++++++++++ 2 files changed, 17 insertions(+) create mode 100755 bin/actions/status.sh diff --git a/bin/actions/status.sh b/bin/actions/status.sh new file mode 100755 index 0000000..f679c58 --- /dev/null +++ b/bin/actions/status.sh @@ -0,0 +1,4 @@ +#!/usr/bin/env zsh + +source ~/dotfiles/bin/helpers/functions.sh + diff --git a/bin/dotf b/bin/dotf index 3c1e0ba..84dc3e8 100755 --- a/bin/dotf +++ b/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 $@