Blame view
script/boxen-my-config
552 Bytes
|
fdb27960f
|
1 2 |
#!/usr/bin/env ruby # Show the path to your manifest in Boxen, creating if necessary. |
|
1e9e96747
|
3 |
user = ENV["BOXEN_GITHUB_LOGIN"] |
|
fdb27960f
|
4 5 |
unless user |
|
1e9e96747
|
6 |
abort "BOXEN_GITHUB_LOGIN is not defined. Please re-run Boxen." |
|
fdb27960f
|
7 8 9 10 11 12 13 14 15 16 17 18 19 |
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
|
|
8229fe238
|
20 |
exec([editor, path].join(' ')) if editor && system("test -t 1")
|
|
fdb27960f
|
21 22 |
puts path |