Fix Script: add first packages in Linux before
This commit is contained in:
parent
e757bcc18b
commit
72d7d1a3fd
@ -23,10 +23,15 @@ casks = [
|
||||
]
|
||||
|
||||
[packages.linux.manjaro]
|
||||
pacman = [
|
||||
pacman_first = [
|
||||
'archlinux-keyring',
|
||||
'chezmoi',
|
||||
'libpamac',
|
||||
'llvm',
|
||||
'llvm-libs',
|
||||
]
|
||||
|
||||
pacman = [
|
||||
'chezmoi',
|
||||
'yay',
|
||||
'base-devel',
|
||||
'fakeroot',
|
||||
@ -42,8 +47,6 @@ pacman = [
|
||||
'go',
|
||||
'nodejs',
|
||||
'jdk-openjdk',
|
||||
'llvm',
|
||||
'llvm-libs',
|
||||
]
|
||||
|
||||
aur = [
|
||||
|
@ -5,6 +5,7 @@
|
||||
{{- /* https://github.com/mriehl/dotfiles/blob/master/run_onchange_packages.sh.tmpl */ -}}
|
||||
#!/usr/bin/env bash
|
||||
|
||||
pacmanFirst_packages=( {{.packages.linux.manjaro.pacman_first | quoteList | join " " }})
|
||||
pacman_packages=( {{.packages.linux.manjaro.pacman | quoteList | join " " }})
|
||||
aur_packages=( {{.packages.linux.manjaro.aur | quoteList | join " " }})
|
||||
|
||||
@ -14,6 +15,18 @@ is_installed() {
|
||||
[[ " ${installed_packages[*]} " =~ " $1 " ]]
|
||||
}
|
||||
|
||||
to_install_pacmanFirst=()
|
||||
for package in "${pacmanFirst_packages[@]}"; do
|
||||
if ! is_installed "$package"; then
|
||||
to_install_pacmanFirst+=("$package")
|
||||
fi
|
||||
done
|
||||
|
||||
if [[ ${#to_install_pacmanFirst[@]} -gt 0 ]]; then
|
||||
echo " - Installing missing packages via pacman: ${to_install_pacmanFirst[@]}"
|
||||
sudo pacman -S --needed --noconfirm "${to_install_pacmanFirst[@]}"
|
||||
fi
|
||||
|
||||
to_install_pacman=()
|
||||
for package in "${pacman_packages[@]}"; do
|
||||
if ! is_installed "$package"; then
|
||||
@ -23,12 +36,12 @@ done
|
||||
|
||||
if [[ ${#to_install_pacman[@]} -gt 0 ]]; then
|
||||
echo " - Installing missing packages via pacman: ${to_install_pacman[@]}"
|
||||
sudo pacman -S --noconfirm "${to_install_pacman[@]}"
|
||||
sudo pacman -S --needed --noconfirm "${to_install_pacman[@]}"
|
||||
fi
|
||||
|
||||
if ! is_installed "yay"; then
|
||||
echo " - Installing yay"
|
||||
sudo pacman -S --noconfirm yay
|
||||
sudo pacman -S --needed --noconfirm yay
|
||||
fi
|
||||
|
||||
to_install_aur=()
|
||||
|
18
Readme.md
18
Readme.md
@ -4,21 +4,27 @@ Yuan dotfile
|
||||
安裝 (個人用途)
|
||||
--------------------------------------------------------------------------------
|
||||
### Linux / macOS
|
||||
#### 1. 放置自己的金鑰(若是其他人要用,請直接跳過)
|
||||
#### 安裝主dotfiles包
|
||||
```
|
||||
sh -c "$(curl -fsLS get.chezmoi.io)" -- init https://git.yuaner.tw/yuan/dotfiles-private.git --apply
|
||||
```
|
||||
|
||||
<details>
|
||||
<summary>私人用安裝方式</summary>
|
||||
##### 1. 放置自己的金鑰(若是其他人要用,請直接跳過)
|
||||
將 `id_rsa` sshkey金鑰檔放到 `~/.ssh/id_rsa`
|
||||
|
||||
#### 2. 安裝主dotfiles包
|
||||
##### 2. 安裝主dotfiles包
|
||||
```
|
||||
#sh -c "$(curl -fsLS get.chezmoi.io)" -- init --apply ssh://git@git.yuaner.tw:10022/yuan/dotfiles.git #私人用
|
||||
sh -c "$(curl -fsLS get.chezmoi.io)" -- init --apply ssh://git@git.yuaner.tw:10022/yuan/dotfiles.git
|
||||
vim +PlugInstall +qall
|
||||
sh -c "$(curl -fsLS get.chezmoi.io)" -- init ssh://git@git.yuaner.tw:10022/yuan/dotfiles.git --apply
|
||||
```
|
||||
|
||||
#### 3. 安裝私人用的dotfiles包(若是其他人要用,請直接跳過)
|
||||
##### 3. 安裝私人用的dotfiles包(若是其他人要用,請直接跳過)
|
||||
```
|
||||
chezmoi init --source ~/.local/share/chezmoi-private --config ~/.config/chezmoi-private/chezmoi.toml ssh://git@git.yuaner.tw:10022/yuan/dotfiles-private.git --apply
|
||||
chezmoi apply
|
||||
```
|
||||
</details>
|
||||
|
||||
#### 若需要刪掉重來
|
||||
```
|
||||
|
Loading…
x
Reference in New Issue
Block a user