-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh.example
More file actions
executable file
·27 lines (23 loc) · 1.19 KB
/
install.sh.example
File metadata and controls
executable file
·27 lines (23 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
#!/usr/bin/env bash
# ensure you set the executable bit on the file with `chmod u+x install.sh`
# If you remove the .example extension from the file, once your workspace is created and the contents of this
# repo are copied into it, this script will execute. This will happen in place of the default behavior of the workspace system,
# which is to symlink the dotfiles copied from this repo to the home directory in the workspace.
#
# Why would one use this file in stead of relying upon the default behavior?
#
# Using this file gives you a bit more control over what happens.
# If you want to do something complex in your workspace setup, you can do that here.
# Also, you can use this file to automatically install a certain tool in your workspace, such as vim.
#
# Just in case you still want the default behavior of symlinking the dotfiles to the root,
# we've included a block of code below for your convenience that does just that.
set -euo pipefail
DOTFILES_PATH="$HOME/dotfiles"
# Symlink dotfiles to the root within your workspace
find $DOTFILES_PATH -type f -path "$DOTFILES_PATH/.*" |
while read df; do
link=${df/$DOTFILES_PATH/$HOME}
mkdir -p "$(dirname "$link")"
ln -sf "$df" "$link"
done