2013-01-08 23:03:34 -05:00
|
|
|
#!/usr/bin/env ruby
|
|
|
|
# Show the path to your manifest in Boxen, creating if necessary.
|
|
|
|
|
2013-02-23 02:53:32 -05:00
|
|
|
user = ENV["BOXEN_GITHUB_LOGIN"]
|
2013-01-08 23:03:34 -05:00
|
|
|
|
|
|
|
unless user
|
2013-02-23 02:53:32 -05:00
|
|
|
abort "BOXEN_GITHUB_LOGIN is not defined. Please re-run Boxen."
|
2013-01-08 23:03:34 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
editor = ENV["VISUAL"] || ENV["EDITOR"]
|
|
|
|
home = ENV["BOXEN_HOME"] + "/repo"
|
|
|
|
user = user.downcase
|
|
|
|
path = "#{home}/modules/people/manifests/#{user}.pp"
|
|
|
|
|
|
|
|
unless File.exist? path
|
|
|
|
File.open path, "wb" do |f|
|
|
|
|
f.puts "class people::#{user} {"
|
|
|
|
f.puts "}"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2013-03-01 18:23:49 -05:00
|
|
|
exec([editor, path].join(' ')) if editor && system("test -t 1")
|
2013-01-08 23:03:34 -05:00
|
|
|
|
|
|
|
puts path
|