This repository has been archived by the owner on Jun 19, 2023. It is now read-only.
forked from dbresson/bedouin
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
David Bresson
committed
Dec 5, 2016
1 parent
1da7891
commit e217075
Showing
3 changed files
with
23 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/usr/bin/env ruby | ||
require 'bedouin' | ||
|
||
exit_val = Bedouin::CLI.new.execute(*ARGV) | ||
|
||
exit exit_val |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
module Bedouin | ||
class CLI | ||
def execute(env_path, *template_paths) | ||
e = Bedouin.environment_for(env_path) | ||
|
||
template_paths.lazy.map do |path| | ||
t = Bedouin.template_for(path) | ||
j = Bedouin::Job.new(e, t) | ||
Bedouin::Runner.new.run(j) | ||
end.reduce(0) do |m,j| | ||
puts j.to_s | ||
j.status == 0 ? m : 1 | ||
end | ||
end | ||
end | ||
end |