add .osid trick
This commit is contained in:
8
.chezmoi.toml.tmpl
Normal file
8
.chezmoi.toml.tmpl
Normal file
@@ -0,0 +1,8 @@
|
||||
{{- $osid := .chezmoi.os -}}
|
||||
{{- if hasKey .chezmoi.osRelease "id" -}}
|
||||
{{- $osid = printf "%s-%s" .chezmoi.os .chezmoi.osRelease.id -}}
|
||||
{{- end -}}
|
||||
|
||||
[data]
|
||||
osid = {{ $osid | quote }}
|
||||
|
||||
@@ -1,16 +1,12 @@
|
||||
#!/usr/bin/env sh
|
||||
echo "Running installation script\n"
|
||||
{{- if eq .chezmoi.os "linux" }}
|
||||
{{- if hasKey .chezmoi.osRelease "id" }} # avoid M1 mac osRelease.id not exist
|
||||
{{- if eq .chezmoi.osRelease.id "alpine" }}
|
||||
{{- if eq .osid "linux-alpine" }}
|
||||
apk update
|
||||
apk add zsh tmux perl bash
|
||||
{{- else if (or (eq .chezmoi.osRelease.id "debian") (eq .chezmoi.osRelease.id "ubuntu")) }}
|
||||
{{- else if (or (eq .osid "debian") (eq .osid "ubuntu")) }}
|
||||
sudo apt update
|
||||
sudo apt install zsh tmux perl bash -y
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- else if eq .chezmoi.os "darwin" }}
|
||||
{{- else if eq .osid "darwin" }}
|
||||
brew install neovim zsh tmux perl
|
||||
{{- end }}
|
||||
# curl -sS https://webinstall.dev/webi | bash
|
||||
|
||||
Reference in New Issue
Block a user