forked from ryanb/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRakefile
77 lines (69 loc) · 1.88 KB
/
Rakefile
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
74
75
76
77
require 'rake'
require 'erb'
require 'fileutils'
require_relative 'dotfiles'
desc "install the dot files into user's home directory"
task :install do
prerequisites
install_oh_my_zsh
install_vim_plug
Dotfiles.new.install
puts '-----------------------------------------------------------------------'
puts 'done.'
end
task :uninstall do
Dotfiles.new.uninstall
end
def prerequisites
puts '-----------------------------------------------------------------------'
puts 'this will install oh-my-zsh, install and configure neovim'
puts 'and some more dotfiles'
puts ''
puts 'please make sure before continuing that the prerequisites are met'
puts ' - git'
puts ''
puts 'these tools you need in order to use the configurations (post-requisites)'
puts ' - neovim'
puts ' - zsh'
puts ' - ctags'
puts ' - ripgrep'
puts ''
print "do you want to proceed? [yn] "
case $stdin.gets.chomp
when 'n'
exit
end
end
def install_oh_my_zsh
if File.exist?(File.join(ENV['HOME'], ".oh-my-zsh"))
puts "found ~/.oh-my-zsh"
else
print "install oh-my-zsh? [ynq] "
case $stdin.gets.chomp
when 'y'
puts "installing oh-my-zsh"
system %Q{git clone https://github.com/robbyrussell/oh-my-zsh.git "$HOME/.oh-my-zsh"}
when 'q'
exit
else
puts "skipping oh-my-zsh, you will need to change ~/.zshrc"
end
end
end
def install_vim_plug
if File.exist?(File.join(ENV['HOME'], ".config/nvim/autoload/plug.vim"))
puts "found ~/.config/nvim/autoload/plug.vim"
else
print "install 'vim-plug'? [ynq] "
case $stdin.gets.chomp
when 'y'
puts "installing vim-plug"
system %Q{mkdir -p "$HOME/.config"}
system %Q{curl -fLo $HOME/.config/nvim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim}
when 'q'
exit
else
puts "skipping vim-plug"
end
end
end