1
0
Fork 0
mirror of https://github.com/kou029w/dotfiles.git synced 2025-01-18 08:05:01 +00:00
dotfiles/mod.bash

41 lines
898 B
Bash
Raw Normal View History

2022-06-14 00:34:22 +09:00
function install_dotfiles() {
local home
local dotfile
home=$(eval "echo ~${SUDO_USER:-}")
for dotfile in .*; do
[[ $dotfile =~ ^(\.\.?|\.git)$ ]] && continue
dotfile=$(realpath "$dotfile")
(
2023-12-29 23:51:12 +09:00
cd -- "$home" || exit 1
2022-06-14 00:34:22 +09:00
ln -svf "$dotfile" .
)
done
}
2022-06-15 00:15:50 +09:00
function install_apt_packages() {
local packages
local apt_sources_dir
. packages.bash
eval "$(apt-config shell apt_sources_dir 'Dir::Etc::sourceparts/d')"
2024-05-07 17:50:11 +09:00
apt update
apt install -y rsync
2022-06-15 00:15:50 +09:00
rsync -rv etc/apt/keyrings/ /usr/share/keyrings/
rsync -rv etc/apt/sources.list.d/ "$apt_sources_dir"
2023-12-29 23:51:12 +09:00
[[ -d etc/default ]] &&
rsync -rv etc/default/ /etc/default/
2022-06-15 00:15:50 +09:00
apt update
apt install -y "${packages[@]}"
2022-06-15 19:54:15 +09:00
rsync -rv etc/apt/sources.list.d/ "$apt_sources_dir"
}
2022-06-14 00:34:22 +09:00
function install_addons() {
local addon
for addon in "$@"; do
(
2023-12-29 23:51:12 +09:00
cd -- "$addon" || exit 1
2022-06-14 00:34:22 +09:00
./install
)
done
}