33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
|
# File 'lib/escalator/cli.rb', line 33
def create(name)
if File.exist? name
puts "ERROR: #{name} already exists."
exit -1
end
root_dir = File.expand_path(File.join(File.dirname(__FILE__), "..", ".."))
template_path = File.join(root_dir, "template", "escalator")
cp_r template_path, name
temlate_plc_path = File.join(root_dir, "lib", "plc")
cp_r temlate_plc_path, name
%w(plc.rb emulator).each do |fn|
rm_r File.join(name, "plc", fn)
end
puts "#{name} was successfully created."
end
|