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
|
#!/usr/bin/env sh
|
||||||
echo "Running installation script\n"
|
echo "Running installation script\n"
|
||||||
{{- if eq .chezmoi.os "linux" }}
|
{{- if eq .osid "linux-alpine" }}
|
||||||
{{- if hasKey .chezmoi.osRelease "id" }} # avoid M1 mac osRelease.id not exist
|
|
||||||
{{- if eq .chezmoi.osRelease.id "alpine" }}
|
|
||||||
apk update
|
apk update
|
||||||
apk add zsh tmux perl bash
|
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 update
|
||||||
sudo apt install zsh tmux perl bash -y
|
sudo apt install zsh tmux perl bash -y
|
||||||
{{- end }}
|
{{- else if eq .osid "darwin" }}
|
||||||
{{- end }}
|
|
||||||
{{- else if eq .chezmoi.os "darwin" }}
|
|
||||||
brew install neovim zsh tmux perl
|
brew install neovim zsh tmux perl
|
||||||
{{- end }}
|
{{- end }}
|
||||||
# curl -sS https://webinstall.dev/webi | bash
|
# curl -sS https://webinstall.dev/webi | bash
|
||||||
|
|||||||
Reference in New Issue
Block a user