Update dotsfile config with variable

This commit is contained in:
Alexander Rosenberg 2023-05-04 01:31:25 -07:00
parent 0f927aa2a0
commit ea0d66cb11
Signed by: Zander671
GPG Key ID: 5FD0394ADBD72730

View File

@ -102,19 +102,13 @@ alias ga="git add"
alias gaa="git add -A" alias gaa="git add -A"
alias gco="git commit" alias gco="git commit"
gcm() { gcm() {
local args local args="${@}"
for arg; do
args="${args} ${arg}"
done
git commit -m "${args:1}" # remove the leading space git commit -m "${args:1}" # remove the leading space
} }
alias gca="git commit -a" alias gca="git commit -a"
gcam() { gcam() {
local args local args="${@}"
for arg; do git commit -am "${args}" # remove the leading space
args="${args} ${arg}"
done
git commit -am "${args:1}" # remove the leading space
} }
alias gp="git push" alias gp="git push"
alias gu="git pull" alias gu="git pull"
@ -122,8 +116,9 @@ alias gf="git fetch"
alias gt="git status" alias gt="git status"
# Dotfile management # Dotfile management
[ -v ZSH_MANAGE_DOTFILES_REPO ] || ZSH_MANAGE_DOTFILES_REPO="${HOME}/src/dotfiles"
function dots { function dots {
local args=("--git-dir=${HOME}/src/dotfiles" '--work-tree=/' '--bare') local args=("--git-dir=${ZSH_MANAGE_DOTFILES_REPO}" '--work-tree=/' '--bare')
if (( ${#} == 0 )); then if (( ${#} == 0 )); then
(cd / (cd /
for file in $(git ${args} ls-files); do for file in $(git ${args} ls-files); do