From 26425d0815ec9d20a10a0c2df02f72236d7e43be Mon Sep 17 00:00:00 2001 From: Buddy Sandidge Date: Fri, 29 Sep 2023 12:58:11 -0700 Subject: [PATCH] Add github_install_scripts to get github paths --- dot_config/profile/profile.d/functions.sh.tmpl | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) 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}"