17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
# File 'lib/kitchenplan/cli.rb', line 17
def setup(targetdir='/opt')
gitrepo = options[:gitrepo]
logo
install_clt unless File.exist? "/Library/Developer/CommandLineTools/usr/bin/clang"
if gitrepo || File.exists?("#{targetdir}/kitchenplan")
fetch(gitrepo, targetdir)
else
has_config = yes?('Do you have a config repository? [y,n]', :green)
if has_config
gitrepo = ask('Please enter the clone URL of your git config repository:', :green)
fetch(gitrepo, targetdir)
else
create(targetdir)
end
end
unless File.exists?("#{targetdir}/kitchenplan/config/people/#{ENV['USER']}.yml")
user_create = options[:config]
user_create = yes?("config/people/#{ENV['USER']}.yml does not exist. Do you wish to create it? [y,n]", :green) if user_create.nil?
if user_create
create_user(targetdir)
end
end
end
|