Compare commits
5 commits
80df1088bd
...
b2009f3948
Author | SHA1 | Date | |
---|---|---|---|
![]() |
b2009f3948 | ||
![]() |
94752b1b5e | ||
![]() |
ba76c66c25 | ||
![]() |
77b49ef219 | ||
![]() |
58c86a7e81 |
3 changed files with 30 additions and 12 deletions
|
@ -17,10 +17,11 @@
|
|||
# executable bool false Add executable_ attribute to file
|
||||
# path string none Path to file in archive
|
||||
*/}}
|
||||
{{- $defaultRefresh := "168h" -}}
|
||||
|
||||
{{- if (env "CZ_EXTR") -}}
|
||||
{{/* Initialize template variables */}}
|
||||
{{- $myArch := "" -}}
|
||||
{{- $defaultRefresh := "168h" -}}
|
||||
{{- $externals := dict -}}
|
||||
|
||||
{{/*
|
||||
|
@ -76,10 +77,7 @@
|
|||
"refreshPeriod" $defaultRefresh
|
||||
) -}}{{- end -}}{{- end -}}{{- end -}}
|
||||
|
||||
{{- $archive_type := "zip" -}}
|
||||
{{- if (eq .chezmoi.os "linux" ) -}}
|
||||
{{- $archive_type = "tgz" -}}
|
||||
{{- end -}}
|
||||
{{- $archive_type := or (get (dict "linux" "tgz") .chezmoi.os) "zip" }}
|
||||
{{- with $app_name := "cargo-binstall" -}}
|
||||
{{- with $repo := (printf "%s/%s" "cargo-bins" $app_name) -}}
|
||||
{{- with $version := (gitHubLatestRelease $repo).GetTagName -}}
|
||||
|
@ -91,6 +89,16 @@
|
|||
"refreshPeriod" $defaultRefresh
|
||||
) -}}{{- end -}}{{- end -}}{{- end -}}
|
||||
|
||||
{{- with $app_name := "tv" -}}
|
||||
{{- with $repo := (printf "%s/%s" "alexpasmantier" "television") -}}
|
||||
{{- with $version := (gitHubLatestRelease $repo).GetTagName -}}
|
||||
{{- $_ := set $externals (printf ".local/bin/%s" $app_name) (dict
|
||||
"type" "archive-file"
|
||||
"url" (printf "https://github.com/%s/releases/download/%s/%s-%s-%s.tar.gz" $repo $version $app_name $version $myArch)
|
||||
"path" (printf "%s-%s-%s/%s" $app_name $version $myArch $app_name)
|
||||
"refreshPeriod" $defaultRefresh
|
||||
) -}}{{- end -}}{{- end -}}{{- end -}}
|
||||
|
||||
{{- if (eq .chezmoi.os "linux") -}}
|
||||
{{- with $app_name := "vivid" -}}
|
||||
{{- with $repo := (printf "%s/%s" "sharkdp" $app_name) -}}
|
||||
|
@ -268,7 +276,12 @@
|
|||
"refreshPeriod" $defaultRefresh
|
||||
) -}}{{- end -}}{{- end -}}{{- end }}{{- end -}}
|
||||
|
||||
{{- $externals | toYaml }}
|
||||
{{- $externals | toYaml -}}
|
||||
{{- else -}}
|
||||
# This is a truncated version of .chezmoiexternal because CZ_EXTR env is undefined
|
||||
|
||||
{{- end }}
|
||||
|
||||
".config/sz.env/lib/ble.sh.curl":
|
||||
type: "archive"
|
||||
url: "https://github.com/akinomyoga/ble.sh/releases/download/nightly/ble-nightly.tar.xz"
|
||||
|
@ -296,7 +309,3 @@
|
|||
executable: true
|
||||
refreshPeriod: "{{ $defaultRefresh }}"
|
||||
{{- end -}}
|
||||
|
||||
{{- else -}}
|
||||
# .chezmoiexternal is disabled because CZ_EXTR env is undefined
|
||||
{{- end -}}
|
||||
|
|
|
@ -5,4 +5,5 @@ if [[ ! "$-" =~ i ]]; then
|
|||
echo "Non interactive session ($-) , stopping load of shell environment" 1>&2
|
||||
else
|
||||
${NO_RESET:+:} reset
|
||||
export NO_RESET=1
|
||||
fi
|
||||
|
|
|
@ -13,9 +13,17 @@ if is_cmd 'chezmoi'; then
|
|||
|
||||
complete -F _complete_alias czg
|
||||
|
||||
czcd() {
|
||||
cd "$(chezmoi source-path "${@}")"
|
||||
chezmoi() {
|
||||
${SET_X:-:} -x
|
||||
case "$1" in
|
||||
"cd") cd "$(chezmoi source-path "${@:2}")" ;;
|
||||
"edit") ${VISUAL:-${EDITOR:-vi}} $(chezmoi source-path "${@:2}") ;;
|
||||
"source-path") printf '%s\n' "${@:2}" | xargs -r chezmoi source-path ;;
|
||||
*) command chezmoi "${@}" ;;
|
||||
esac
|
||||
${SET_X:-:} +x
|
||||
}
|
||||
czcd() { chezmoi cd "${@}"; }
|
||||
czedext() {
|
||||
local CZ_EXT="$(find $(chezmoi source-path) -mindepth 1 -maxdepth 1 -name '.chezmoiexternal.*')"
|
||||
CZ_EXT="${CZ_EXT:-$(chezmoi source-path "${@}")/.chezmoiexternal.yaml.tmpl}"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue