mirror of
https://github.com/kou029w/dotfiles.git
synced 2025-01-19 00:17:59 +00:00
support sudo
This commit is contained in:
parent
0b41faff6b
commit
74b2549c68
1 changed files with 3 additions and 1 deletions
4
install
4
install
|
@ -3,13 +3,15 @@ set -euo pipefail
|
||||||
cd -- "$(dirname -- "$0")"
|
cd -- "$(dirname -- "$0")"
|
||||||
|
|
||||||
function main() {
|
function main() {
|
||||||
|
local home
|
||||||
local dotfile
|
local dotfile
|
||||||
|
home=$(eval echo ~"${SUDO_USER:-$(id -un)}")
|
||||||
for dotfile in .*; do
|
for dotfile in .*; do
|
||||||
[[ $dotfile =~ ^(\.\.?|\.git)$ ]] && continue
|
[[ $dotfile =~ ^(\.\.?|\.git)$ ]] && continue
|
||||||
|
|
||||||
dotfile=$(realpath "$dotfile")
|
dotfile=$(realpath "$dotfile")
|
||||||
(
|
(
|
||||||
cd
|
cd -- "$home"
|
||||||
ln -svf "$dotfile" .
|
ln -svf "$dotfile" .
|
||||||
)
|
)
|
||||||
done
|
done
|
||||||
|
|
Loading…
Add table
Reference in a new issue