mirror of
https://github.com/kou029w/dotfiles.git
synced 2025-01-18 08:05:01 +00:00
create homebrew addon
This commit is contained in:
parent
d1514ba0e1
commit
f3b0f9dfe2
4 changed files with 19 additions and 13 deletions
|
@ -13,5 +13,5 @@ sudo ./install
|
||||||
or
|
or
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
sudo ./install desktop
|
sudo ./install homebrew desktop
|
||||||
```
|
```
|
||||||
|
|
18
homebrew/install
Executable file
18
homebrew/install
Executable file
|
@ -0,0 +1,18 @@
|
||||||
|
#!/bin/bash
|
||||||
|
set -euo pipefail
|
||||||
|
cd -- "$(dirname -- "$0")"
|
||||||
|
|
||||||
|
function install_homebrew_packages() {
|
||||||
|
local uid
|
||||||
|
uid=${SUDO_UID:-$(id -u)}
|
||||||
|
sudo --user="#$uid" \
|
||||||
|
mkdir -p /home/linuxbrew/.linuxbrew
|
||||||
|
sudo --user="#$uid" \
|
||||||
|
NONINTERACTIVE=1 \
|
||||||
|
bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
|
||||||
|
sudo --user="#$uid" \
|
||||||
|
/home/linuxbrew/.linuxbrew/bin/brew bundle --global
|
||||||
|
}
|
||||||
|
|
||||||
|
[[ $(uname -sm) =~ ^(Linux x86_64)$ ]] \
|
||||||
|
&& install_homebrew_packages
|
2
install
2
install
|
@ -5,8 +5,6 @@ cd -- "$(dirname -- "$0")"
|
||||||
if (($(id -u) == 0)); then
|
if (($(id -u) == 0)); then
|
||||||
[[ -f /etc/debian_version ]] \
|
[[ -f /etc/debian_version ]] \
|
||||||
&& install_apt_packages
|
&& install_apt_packages
|
||||||
[[ $(uname -sm) =~ ^(Linux x86_64|Darwin .*)$ ]] \
|
|
||||||
&& install_homebrew_packages
|
|
||||||
fi
|
fi
|
||||||
install_dotfiles
|
install_dotfiles
|
||||||
install_addons "$@"
|
install_addons "$@"
|
||||||
|
|
10
mod.bash
10
mod.bash
|
@ -27,16 +27,6 @@ function install_apt_packages() {
|
||||||
rsync -rv etc/apt/sources.list.d/ "$apt_sources_dir"
|
rsync -rv etc/apt/sources.list.d/ "$apt_sources_dir"
|
||||||
}
|
}
|
||||||
|
|
||||||
function install_homebrew_packages() {
|
|
||||||
local uid
|
|
||||||
uid=${SUDO_UID:-$(id -u)}
|
|
||||||
sudo --user="#$uid" \
|
|
||||||
NONINTERACTIVE=1 \
|
|
||||||
bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
|
|
||||||
sudo --user="#$uid" \
|
|
||||||
/home/linuxbrew/.linuxbrew/bin/brew bundle --file=.Brewfile
|
|
||||||
}
|
|
||||||
|
|
||||||
function install_addons() {
|
function install_addons() {
|
||||||
local addon
|
local addon
|
||||||
for addon in "$@"; do
|
for addon in "$@"; do
|
||||||
|
|
Loading…
Add table
Reference in a new issue