-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup-dotfiles
More file actions
executable file
·29 lines (23 loc) · 817 Bytes
/
setup-dotfiles
File metadata and controls
executable file
·29 lines (23 loc) · 817 Bytes
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
#!/usr/bin/env ruby
require 'fileutils'
def link(path, link_name)
path = File.expand_path path
link_name = File.expand_path link_name
puts "linking #{link_name}..."
if File.symlink? link_name
puts "\tRemoving symlink..."
FileUtils.rm link_name
elsif File.exists? link_name
puts "\tSkipping because a file already exists."
return
end
FileUtils.ln_s(path, link_name)
end
puts "Bootstrapping Dotfiles..."
link "~/.computer-setup/dotfiles/vim/.vimrc", "~/.vimrc"
link "~/.computer-setup/dotfiles/git/.gitconfig", "~/.gitconfig"
link "~/.computer-setup/dotfiles/zsh/.zshrc", "~/.zshrc"
link "~/.computer-setup/dotfiles/emacs/.emacs.d/", "~/.emacs.d/"
link "~/.computer-setup/dotfiles/tmux/.tmux.conf", "~/.tmux.conf"
link "~/.computer-setup/dotfiles/.profile", "~/.profile"
puts "done"