Small path adjustments

This commit is contained in:
Aaron Fischer 2021-12-06 15:04:28 +01:00
parent 5a4832582a
commit e28fd95ce8
No known key found for this signature in database
GPG key ID: CB8E2DBACD93CE77
2 changed files with 5 additions and 4 deletions

5
c.sh
View file

@ -2,7 +2,7 @@
[[ $# -eq 0 ]] && echo "no subcommand given" && exit 1
WORKDIR="$(dirname "$(realpath "$0")")"
WORKDIR="$(dirname "$(realpath "$0")")/repo"
PWD=`pwd`
RESOURCE_TO_TRACK=""
@ -14,7 +14,7 @@ case $1 in
"commit")
shift
MESSAGE="$*"
[[ "$MESSAGE" = "" ]] && MESSAGE="config.sh commit from $HOSTNAME"
[[ "$MESSAGE" = "" ]] && MESSAGE="c.sh commit from $HOSTNAME"
git add --all
git commit -m "$MESSAGE"
;;
@ -61,6 +61,7 @@ case $1 in
echo "push (push the changes to git)"
echo "track (add a file or folder to git)"
echo "diff (show unpushed changes)"
echo "log (show last commits)"
;;
esac

View file

@ -1,6 +1,6 @@
CSTATUS=""
update_cstatus() {
git_stat=`cd /opt/tools/server-config/; git diff --shortstat | tr -c -d '[0-9,]'`
git_stat=`cd /opt/tools/c/; git diff --shortstat | tr -c -d '[0-9,]'`
if [[ "$git_stat" = "" ]]; then
CSTATUS=""
else
@ -16,5 +16,5 @@ add-zsh-hook precmd update_cstatus
setopt PROMPT_SUBST
PS1='%T $CSTATUS %(?.%F{green}√.%F{red}?%?)%f %F{#666}%~%f %# '
alias c="/opt/tools/server-config/c.sh"
alias c="/opt/tools/c/c.sh"