-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsync.nu
More file actions
73 lines (65 loc) · 1.69 KB
/
Copy pathsync.nu
File metadata and controls
73 lines (65 loc) · 1.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
def main [] {
let paths = [
~/.gitconfig
~/.psqlrc
~/.less
~/.zshrc
~/.tmux.conf
~/.rndebuggerrc
~/.config/kitty
~/.config/pgcli
~/.config/litecli
~/.config/starship.toml
~/.config/fish
~/.config/zk
~/.config/nvim
~/.config/alacritty
~/.config/fontconfig/fonts.conf
~/.config/wezterm
~/.config/helix
~/.config/picom
~/.config/bspwm
~/.config/sxhkd
~/.config/rofi
~/.config/polybar
~/.config/nushell
"~/Library/Application Support/nushell"
~/.config/zathura
~/.config/i3
~/.config/zellij
~/.config/dunst
~/.config/watson
~/.config/lazygit
~/.config/btop
~/.config/ghostty
~/.config/yazi
~/.config/gh-dash
"~/Library/Application Support/usql"
]
$paths | each {
let path = $in | path relative-to ''
let item = $path | path basename
let dir = $path | path dirname
print $path
print $item
print $dir
if ($in | str starts-with '/') {
print $'($path) is unsafe'
exit 1
}
if ($in == '~') {
print $'($path) is unsafe'
exit 1
}
if not ($'~/dotfiles/($item)' | path exists) {
print $'($item) not found in dotfiles'
exit 1
}
rm -rf $path
if not ($dir | path exists) {
mkdir $dir
}
ln -s $'($env.HOME)/dotfiles/($item)' $path
print "----------------------------------------"
}
}