-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmake_symlinks.sh
More file actions
executable file
·49 lines (43 loc) · 1.19 KB
/
Copy pathmake_symlinks.sh
File metadata and controls
executable file
·49 lines (43 loc) · 1.19 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
#!/bin/bash -e
echo "Making symlinks"
if which wslpath && ! test $(wslpath $(wslvar USERPROFILE)) = $HOME; then
echo "ERROR: Set home to $(wslpath $(wslvar USERPROFILE)) in /etc/passwd, and log out and back in, first"
exit 1
elif which wslpath; then
mkdir -p /home/.wsl/$USER/.ssh
ln -fs /home/.wsl/$USER/.ssh .ssh
else
mkdir -p .ssh
fi
if which brew &> /dev/null
then
PATH="$(brew --prefix)/opt/coreutils/libexec/gnubin:$PATH"
fi
for f in ./.* ; do
if [ $f != "./." ] && [ $f != "./.." ] && [ $f != "./.git" ] ; then
target="$(readlink -f $f)"
name="$HOME/$f"
echo "Linking name $name to target $target"
ln -fs $target $name
else
echo "Skipped " $f
fi
done
winhome='/mnt/c/Users/Else'
if test -d $winhome
then
vsc_dir=$winhome/Application\ Data/Code/User
ln -Tfs $(readlink -f ~/.ssh) $winhome/.ssh
elif test -d ~/Library
then
vsc_dir=~/Library/Application\ Support/Code/User
else
vsc_dir="~/.config/Code/User"
fi
if which wslpath; then
cp ssh_config ~/.ssh/config
else
ln -fs $(readlink -f ssh_config) ~/.ssh/config
fi
mkdir -p "$vsc_dir"
ln -fs $(readlink -f vscode_settings.json) "$vsc_dir/settings.json"