Class: Install

Inherits:
Object
  • Object
show all
Defined in:
lib/playbook/install.rb

Class Method Summary collapse

Class Method Details

.runObject



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/playbook/install.rb', line 5

def self.run
    
    unless File.exist?("playbooks.yml")
        puts "No \"playbooks.yml\" file found."
        exit 1
    end


    playbooks = YAML.load_file("playbooks.yml")

    FileUtils.rm_rf "playbooks"
    FileUtils.mkdir_p "playbooks"
    Dir.chdir "playbooks"

    playbooks.each do |playbook|
        git_url = "https://github.com/#{playbook}.git"
        repo = Git.clone(git_url, playbook)
    end

end