7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
# File 'lib/fir/generator.rb', line 7
def generate!(args)
unless args.length >= 1
raise 'Usage: fir path'
end
fir_root = args.shift
if File.exists?(fir_root)
raise "#{fir_root} already exists! Aborting."
end
FileUtils.cp_r FIR_SKELETON_ROOT, fir_root
FileUtils.mv File.join(fir_root, 'public', 'htaccess'), File.join(fir_root, 'public', '.htaccess')
puts "Created new Fir site in #{fir_root}"
[
['--with-dispatch-cgi', 'public/dispatch.cgi'],
['--with-htaccess', 'public/.htaccess']
].each do |option, file|
unless args.include?(option)
FileUtils.rm File.join(fir_root, file)
end
end
end
|