Skip to content

Instantly share code, notes, and snippets.

@ErnestoCobos
Created February 20, 2024 14:38
Show Gist options
  • Save ErnestoCobos/16204ecd7dbd1ffb5c4e42c693182c63 to your computer and use it in GitHub Desktop.
Save ErnestoCobos/16204ecd7dbd1ffb5c4e42c693182c63 to your computer and use it in GitHub Desktop.
The idea is to show here the configuration fragment that is used in .zshrc (mac) for the configuration of the script
# ##############################################
# ## DYNAMIC GIT CONFIGURATOR FOR ZSH SHELL ##
# ## Automates Git configuration on-the-fly ##
# ## based on the current working directory ##
# ## and user-defined scripts. ##
# ##############################################
# ## - Auto-loads with Zsh
# ## - Hooks into directory change events
# ## - Executes Git configuration scripts
# ## - Allows manual addition of Git configs
# ##############################################
source ~/ToolBox/Scripts/DynamicGitConfigurator.sh/DynamicGitConfigurator.sh
autoload -U add-zsh-hook
add-zsh-hook chpwd _execute_git_configurator
_execute_git_configurator() {
~/ToolBox/Scripts/DynamicGitConfigurator.sh/DynamicGitConfigurator.sh
}
function addGitConfig() {
~/ToolBox/Scripts/DynamicGitConfigurator.sh/addGitConfig.sh
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment