Small path adjustments
This commit is contained in:
parent
5a4832582a
commit
e28fd95ce8
2 changed files with 5 additions and 4 deletions
5
c.sh
5
c.sh
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
[[ $# -eq 0 ]] && echo "no subcommand given" && exit 1
|
[[ $# -eq 0 ]] && echo "no subcommand given" && exit 1
|
||||||
|
|
||||||
WORKDIR="$(dirname "$(realpath "$0")")"
|
WORKDIR="$(dirname "$(realpath "$0")")/repo"
|
||||||
PWD=`pwd`
|
PWD=`pwd`
|
||||||
|
|
||||||
RESOURCE_TO_TRACK=""
|
RESOURCE_TO_TRACK=""
|
||||||
|
@ -14,7 +14,7 @@ case $1 in
|
||||||
"commit")
|
"commit")
|
||||||
shift
|
shift
|
||||||
MESSAGE="$*"
|
MESSAGE="$*"
|
||||||
[[ "$MESSAGE" = "" ]] && MESSAGE="config.sh commit from $HOSTNAME"
|
[[ "$MESSAGE" = "" ]] && MESSAGE="c.sh commit from $HOSTNAME"
|
||||||
git add --all
|
git add --all
|
||||||
git commit -m "$MESSAGE"
|
git commit -m "$MESSAGE"
|
||||||
;;
|
;;
|
||||||
|
@ -61,6 +61,7 @@ case $1 in
|
||||||
echo "push (push the changes to git)"
|
echo "push (push the changes to git)"
|
||||||
echo "track (add a file or folder to git)"
|
echo "track (add a file or folder to git)"
|
||||||
echo "diff (show unpushed changes)"
|
echo "diff (show unpushed changes)"
|
||||||
|
echo "log (show last commits)"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
CSTATUS=""
|
CSTATUS=""
|
||||||
update_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
|
if [[ "$git_stat" = "" ]]; then
|
||||||
CSTATUS=""
|
CSTATUS=""
|
||||||
else
|
else
|
||||||
|
@ -16,5 +16,5 @@ add-zsh-hook precmd update_cstatus
|
||||||
setopt PROMPT_SUBST
|
setopt PROMPT_SUBST
|
||||||
PS1='%T $CSTATUS %(?.%F{green}√.%F{red}?%?)%f %F{#666}%~%f %# '
|
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"
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue