-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
56 lines (52 loc) · 1.56 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
require 'pry'
def install_java
sh 'add-apt-repository ppa:webupd8team/java'
sh 'apt-get update'
sh 'apt-get install oracle-java8-installer'
sh 'echo oracle-java8-installer shared/accepted-oracle-license-v1-1 select true | sudo /usr/bin/debconf-set-selections'
sh 'update-java-alternatives -s java-8-oracle'
end
SCRIPT_DIR = 'scripts'
TEMPLATE_DIR = 'templates'
namespace 'config' do
desc ''
task :bashrc do
sh("cp #{TEMPLATE_DIR}/.bashrc ~/")
sh("source #{TEMPLATE_DIR}/.bashrc")
end
desc 'Adding common vimrc tricks'
task :vimrc do
sh("cp #{TEMPLATE_DIR}/.vimrc ~/")
sh("source #{TEMPLATE_DIR}/.vimrc")
end
desc 'Adding bash colorful'
task :bashcolors do
sh("cp #{TEMPLATE_DIR}/.bashcolors ~/")
end
desc 'Provides IntelliJ for ubuntu easier'
task :ubuntu_install_intelliJ => :ubuntu_install_java do
sh 'wget -O /tmp/intellij.tar.gz http://download.jetbrains.com/idea/ideaIC-12.0.4.tar.gz'
sh 'tar xfz /tmp/intellij.tar.gz'
sh 'cd idea-IC-123.169/bin'
sh './idea.sh'
sh 'cp ../ /usr/share/applications/IDEA.desktop '
end
desc 'Adding some alias and configurations to your gitconfig'
task :gitconfig do
sh("cp #{TEMPLATE_DIR}/.gitconfig ~/")
end
desc 'Install Java-8 on Ubuntu'
task :ubuntu_install_java do
binding.pry
if (!sh('which /usr/bin/java'))
install_java
else
puts 'You already have java, do you want to continue and overwrite it? (Y / N)'
choice = gets.chomp!
if (choice.upcase == 'Y')
install_java
end
end
end
end
task :default => []