Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions dotman.sh
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,11 @@ dot_pull() {
git -C "$dot_repo" pull origin "${GET_BRANCH}"
}

diff_check() {
dot_repo_status() {

[[ -z $1 ]] && local file_arr

git -C "$DOT_REPO" status

# dotfiles in repository
readarray -t dotfiles_repo < <( find "${HOME}/${DOT_DEST}/$(basename "${DOT_REPO}")" -maxdepth 1 -name ".*" -type f )
Expand All @@ -147,8 +149,8 @@ diff_check() {
[ ${#file_arr} == 0 ] && printf "\n%s\n" "${BOLD}No Changes in dotfiles.${RESET}";return
}

show_diff_check() {
diff_check "show"
show_dot_repo_status() {
dot_repo_status "show"
}

dot_push() {
Expand Down Expand Up @@ -212,7 +214,7 @@ initial_setup() {
manage() {
while :
do
printf "\n%s" "[${BOLD}1${RESET}] Show diff"
printf "\n%s" "[${BOLD}1${RESET}] Show dotfile repo status"
printf "\n%s" "[${BOLD}2${RESET}] Push changed dotfiles"
printf "\n%s" "[${BOLD}3${RESET}] Pull latest changes"
printf "\n%s" "[${BOLD}4${RESET}] List all dotfiles"
Expand All @@ -221,7 +223,7 @@ manage() {
# Default choice is [1], See Parameter Expansion
USER_INPUT=${USER_INPUT:-1}
case $USER_INPUT in
[1]* ) show_diff_check;;
[1]* ) show_dot_repo_status;;
[2]* ) dot_push;;
[3]* ) dot_pull;;
[4]* ) find_dotfiles;;
Expand Down