add command to print the git alias for dotfiles
This commit is contained in:
parent
3481e63d19
commit
10258dc0c7
1 changed files with 8 additions and 1 deletions
|
@ -5,7 +5,7 @@ DOTFILES_REMOTE="${DOTFILES_REMOTE:-git@github.com:Klowner/dotfiles}"
|
||||||
DOTFILES_BRANCH="${DOTFILES_BRANCH:-main}"
|
DOTFILES_BRANCH="${DOTFILES_BRANCH:-main}"
|
||||||
DOTFILES_WORK_TREE="${DOTFILES_WORK_TREE:-$HOME}"
|
DOTFILES_WORK_TREE="${DOTFILES_WORK_TREE:-$HOME}"
|
||||||
DOTFILES_ALIAS="/usr/bin/git --git-dir=${DOTFILES_ROOT} --work-tree=${DOTFILES_WORK_TREE}"
|
DOTFILES_ALIAS="/usr/bin/git --git-dir=${DOTFILES_ROOT} --work-tree=${DOTFILES_WORK_TREE}"
|
||||||
DEPENDENCIES=(git zsh)
|
DEPENDENCIES=(git zsh ssh)
|
||||||
|
|
||||||
function has() {
|
function has() {
|
||||||
return $(which $1 &> /dev/null)
|
return $(which $1 &> /dev/null)
|
||||||
|
@ -62,6 +62,11 @@ function install() {
|
||||||
dotfiles config --local status.showUntrackedFiles no
|
dotfiles config --local status.showUntrackedFiles no
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function echo_alias {
|
||||||
|
echo $DOTFILES_ALIAS
|
||||||
|
exit 0
|
||||||
|
}
|
||||||
|
|
||||||
# If this script is being piped from curl
|
# If this script is being piped from curl
|
||||||
if ! tty >/dev/null; then
|
if ! tty >/dev/null; then
|
||||||
install
|
install
|
||||||
|
@ -72,10 +77,12 @@ fi
|
||||||
case "${1:-help}" in
|
case "${1:-help}" in
|
||||||
info) info;;
|
info) info;;
|
||||||
install) install;;
|
install) install;;
|
||||||
|
alias) echo_alias;;
|
||||||
help)
|
help)
|
||||||
echo "dotfiles commands: "
|
echo "dotfiles commands: "
|
||||||
echo " - install"
|
echo " - install"
|
||||||
echo " - info"
|
echo " - info"
|
||||||
|
echo " - alias"
|
||||||
echo "all other commands will be forwarded to git"
|
echo "all other commands will be forwarded to git"
|
||||||
;;
|
;;
|
||||||
*) eval $DOTFILES_ALIAS $*;;
|
*) eval $DOTFILES_ALIAS $*;;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue