mirror of
https://github.com/kou029w/dotfiles.git
synced 2025-01-18 16:07:59 +00:00
20 lines
336 B
Bash
Executable file
20 lines
336 B
Bash
Executable file
#!/bin/bash
|
|
set -euo pipefail
|
|
cd -- "$(dirname -- "$0")"
|
|
|
|
function main() {
|
|
local home
|
|
local dotfile
|
|
home=$(eval echo ~"${SUDO_USER:-$(id -un)}")
|
|
for dotfile in .*; do
|
|
[[ $dotfile =~ ^(\.\.?|\.git)$ ]] && continue
|
|
|
|
dotfile=$(realpath "$dotfile")
|
|
(
|
|
cd -- "$home"
|
|
ln -svf "$dotfile" .
|
|
)
|
|
done
|
|
}
|
|
|
|
main
|