my-boxen/script/boxen-my-config
2013-02-12 16:41:56 -08:00

24 lines
520 B
Ruby
Executable file

#!/usr/bin/env ruby
# Show the path to your manifest in Boxen, creating if necessary.
user = ENV["GH_LOGIN"]
unless user
abort "GH_LOGIN is not defined. Please re-run Boxen."
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
exec(editor, path) if editor && system("test -t 1")
puts path