apache-config-generator/bin/apache-configurator

30 lines
837 B
Plaintext
Raw Permalink Normal View History

2010-05-06 15:05:24 +00:00
#!/usr/bin/env ruby
require 'fileutils'
require 'rubygems'
require 'rainbow'
2010-05-06 15:05:24 +00:00
2010-09-15 22:31:29 +00:00
if !ARGV[0]
puts "Directory name required.".foreground(:red)
2010-09-15 22:31:29 +00:00
exit 1
end
if File.directory?(ARGV[0])
puts "You can't overwrite an existing directory.".foreground(:red)
2010-05-06 15:05:24 +00:00
exit 1
end
puts "Copying skel files...".foreground(:green)
2010-05-06 15:05:24 +00:00
FileUtils.cp_r File.expand_path(File.join(File.dirname(__FILE__), '..', 'skel')), ARGV[0]
puts "Making config directories...".foreground(:green)
2010-05-06 15:05:24 +00:00
FileUtils.mkdir_p File.join(ARGV[0], 'source')
FileUtils.mkdir_p File.join(ARGV[0], 'conf.d-original')
2010-05-06 15:05:24 +00:00
FileUtils.mkdir_p File.join(ARGV[0], 'conf.d')
print "Complete! ".bright.foreground(:green)
print "cd #{ARGV[0]}".bright.foreground(:yellow)
print " and run ".foreground(:green)
print "bundle exec rake -T ".bright.foreground(:yellow)
puts "to get started.".foreground(:green)