diff --git a/dot_config/profile/profile.d/functions.sh.tmpl b/dot_config/profile/profile.d/functions.sh.tmpl index bb46dcb..10e58c6 100644 --- a/dot_config/profile/profile.d/functions.sh.tmpl +++ b/dot_config/profile/profile.d/functions.sh.tmpl @@ -1,4 +1,5 @@ -# vim: filetype=sh +# chezmoi:template:left-delimiter=#{{ +#{{- /* vim: set filetype=sh: */ -}} #shellcheck shell=sh source_env_file() { @@ -13,6 +14,21 @@ source_env_file() { )" } +#{{ if lookPath "rg" -}} +github_install_scripts () ( + rg github.com "${HOME}/.local/bin" \ + | sed 's/:/ /' \ + | sed 's/=/ /g' \ + | awk '{print $3}' \ + | sed 's|https://github.com/||g' \ + | sed 's|/| |g' \ + | awk '{print $1 " " $2}' \ + | sed 's| |/|g' \ + | sort \ + | uniq +) +#{{- end }} + make_scripts() ( for FILE in "$@"; do make_script "${FILE}"