-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·33 lines (28 loc) · 1.11 KB
/
setup.sh
File metadata and controls
executable file
·33 lines (28 loc) · 1.11 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
#!/bin/bash
DOTFILES_DIRECTORY="`pwd`"
VSCODE="${HOME}/.config/Code/User"
TEMP="${HOME}/.tmpdotfiles"
linkhome() {
cp "${HOME}/${2}" "$TEMP" 2>/dev/null
# Force create/replace the symlink.
ln -fs "${DOTFILES_DIRECTORY}/${1}" "${HOME}/${2}"
}
linkvscode(){
# Force create/replace the symlink.
ln -fs "${DOTFILES_DIRECTORY}/${1}" "${VSCODE}/${2}"
}
printf "Create Symlinks with backup.\n"
mkdir -p $TEMP
# Create the necessary symbolic links between the `.dotfiles` and the appropriate directory.
# The `bash_profile` sources other files directly from the `dotfiles` repository.
linkhome "shell/.bashrc" ".bashrc"
linkhome "shell/.bash_profile" ".bash_profile"
linkhome "git/.gitattributes" ".gitattributes"
linkhome "git/.gitignore" ".gitignore"
linkhome "git/.gitconfig" ".gitconfig"
linkhome "vim/.vimrc" ".vimrc"
mkdir -p ~/.global-modules
linkhome "npm/.npmrc" ".npmrc"
linkvscode "vscode/keybindings.json" "keybindings.json"
linkvscode "vscode/settings.json" "settings.json"
linkvscode "vscode/snippets/" "snippets"