X-Git-Url: https://feistymeow.org/gitweb/?a=blobdiff_plain;f=scripts%2Frev_control%2Fbranchy.sh;h=98e21387c5c0f4b28f3457cedf86877a36fe6754;hb=de0da7f2f7958d4ba652ff2ef5c79991700141ac;hp=5bcedc8537986e68dcd39d189f303595e2c568ac;hpb=c69e74d93c636957b7a959a41ec536fe542ac00a;p=feisty_meow.git diff --git a/scripts/rev_control/branchy.sh b/scripts/rev_control/branchy.sh index 5bcedc85..98e21387 100644 --- a/scripts/rev_control/branchy.sh +++ b/scripts/rev_control/branchy.sh @@ -1,7 +1,7 @@ #!/bin/bash -# branchy: lists the branches active on all of the folders present in the -# REPOSITORY_LIST variable or in paths provided on the command line. +# branchy: lists the branches active on all of the paths provided on the command line. +# if no directory is specified, this defaults to operating on the current directory. source "$FEISTY_MEOW_SCRIPTS/core/launch_feisty_meow.sh" source "$FEISTY_MEOW_SCRIPTS/rev_control/version_control.sh" @@ -10,22 +10,31 @@ save_terminal_title ############## -###echo "showing repository branches at: $(date)" +## holding old implem: +#FULL_LIST="$@" +## use the current directory if no paths were provided. +#if [ -z "$FULL_LIST" ]; then +# FULL_LIST="." +#fi# +#show_active_branch $FULL_LIST +#exit_on_error "showing branches: $FULL_LIST" + +dir="$1"; shift +if [ -z "$dir" ]; then + dir=. +fi -FULL_LIST="$@" +pushd "$dir" &>/dev/null +exit_on_error "changing to directory: $dir" +tempfile=$(generate_rev_ctrl_filelist) +popd &>/dev/null -# only add the standard feisty meow repo list items if we were given no args on command line. -#hmmm: below seems to be oddly just major locations; is the repo list all relative names? -if [ -z "$FULL_LIST" ]; then - FULL_LIST=" $(dirname $FEISTY_MEOW_APEX) $HOME " - if [ "$OS" == "Windows_NT" ]; then - FULL_LIST+=" c:/ d:/ e:/ " - fi -fi +perform_revctrl_action_on_file "$tempfile" show_active_branch +exit_on_error "performing revision control action show_active_branch on: $tempfile" -show_active_branch $FULL_LIST -exit_on_error "showing branches: $FULL_LIST" +rm "$tempfile" ############## restore_terminal_title +