1
0
Fork 0
my-boxen/script/boxen-my-config

25 lines
565 B
Ruby
Executable File

#!/usr/bin/env ruby
# Show the path to your manifest in Boxen, creating if necessary.
user = ENV["BOXEN_GITHUB_LOGIN"]
unless user
abort "BOXEN_GITHUB_LOGIN is not defined. Please re-run Boxen."
end
editor = ENV["VISUAL"] || ENV["EDITOR"]
home = ENV["BOXEN_HOME"] + "/repo"
user = user.downcase.tr('-', '_')
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].join(' ')) if editor && system("test -t 1")
puts path