Skip to content

Commit

Permalink
Avoid installing direnv and pkgx on devcontainers if there already
Browse files Browse the repository at this point in the history
  • Loading branch information
felipecrs committed Mar 4, 2024
1 parent d70e5b7 commit aafdc45
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions home/.chezmoiexternal.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,21 @@
{{ $gitaliasRevision := includeTemplate "get-github-head-revision" (list "GitAlias/gitalias" $cache) }}
url: "https://github.com/GitAlias/gitalias/raw/{{ $gitaliasRevision }}/gitalias.txt"

{{ if not .is_devcontainer | or (.is_devcontainer | and (not (lookPath "direnv"))) -}}
".local/bin/direnv":
type: file
{{ $direnvVersion := includeTemplate "get-github-latest-version" (list "direnv/direnv" $cache) }}
url: "https://github.com/direnv/direnv/releases/download/v{{ $direnvVersion }}/direnv.linux-{{ .chezmoi.arch }}"
executable: true
{{- end }}

{{ if not .is_devcontainer | or (.is_devcontainer | and (not (lookPath "pkgx"))) -}}
".local/bin/pkgx":
type: archive-file
{{ $pkgxVersion := includeTemplate "get-github-latest-version" (list "pkgxdev/pkgx" $cache) }}
url: "https://github.com/pkgxdev/pkgx/releases/download/v{{ $pkgxVersion }}/pkgx-{{ $pkgxVersion }}+linux+{{ .uname_arch | replace "_" "-" }}.tar.xz"
path: pkgx
{{- end }}

{{ if not .is_devcontainer -}}
".local/bin/kubecolor":
Expand Down
1 change: 1 addition & 0 deletions home/.chezmoitemplates/vscode-library
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ wanted_extensions=(
function is_vscode_extension_installed() {
local extension="$1"

# shellcheck disable=SC2312
code --list-extensions 2>/dev/null | grep "${extension}" >/dev/null
}

Expand Down

0 comments on commit aafdc45

Please sign in to comment.