Commit c766b578c1a27cce0b2e0c1a583ecd25b24cd043
Merge pull request #87 from indirect/my-config
work with EDITOR like 'mate -w'
Showing 1 changed file Inline Diff
script/boxen-my-config
#!/usr/bin/env ruby | 1 | 1 | #!/usr/bin/env ruby | |
# Show the path to your manifest in Boxen, creating if necessary. | 2 | 2 | # Show the path to your manifest in Boxen, creating if necessary. | |
3 | 3 | |||
user = ENV["BOXEN_GITHUB_LOGIN"] | 4 | 4 | user = ENV["BOXEN_GITHUB_LOGIN"] | |
5 | 5 | |||
unless user | 6 | 6 | unless user | |
abort "BOXEN_GITHUB_LOGIN is not defined. Please re-run Boxen." | 7 | 7 | abort "BOXEN_GITHUB_LOGIN is not defined. Please re-run Boxen." | |
end | 8 | 8 | end | |
9 | 9 | |||
editor = ENV["VISUAL"] || ENV["EDITOR"] | 10 | 10 | editor = ENV["VISUAL"] || ENV["EDITOR"] | |
home = ENV["BOXEN_HOME"] + "/repo" | 11 | 11 | home = ENV["BOXEN_HOME"] + "/repo" | |
user = user.downcase | 12 | 12 | user = user.downcase | |
path = "#{home}/modules/people/manifests/#{user}.pp" | 13 | 13 | path = "#{home}/modules/people/manifests/#{user}.pp" | |
14 | 14 | |||
unless File.exist? path | 15 | 15 | unless File.exist? path | |
File.open path, "wb" do |f| | 16 | 16 | File.open path, "wb" do |f| | |
f.puts "class people::#{user} {" | 17 | 17 | f.puts "class people::#{user} {" | |
f.puts "}" | 18 | 18 | f.puts "}" | |
end | 19 | 19 | end |