lib/bones/main.rb
# Create a new project from the bones/data project template.
#
Create a new project from the bones/data project template.
Create a new project from the bones / data project template .
def create
    abort "'#{output_dir}' already exists" if test ?e, output_dir
    begin
      files_to_copy.each {|fn| cp fn}
      pwd = File.expand_path(FileUtils.pwd)
      msg = "created '#{name}'"
      msg << " in directory '#{output_dir}'" if name != output_dir
      STDOUT.puts msg
      if test(?f, File.join(output_dir, 'Rakefile'))
        begin
          FileUtils.cd output_dir
          system "rake manifest:create 2>&1 > #{::Bones::DEV_NULL}"
          STDOUT.puts "now you need to fix these files"
          system "rake notes"
        ensure
          FileUtils.cd pwd
        end
      end
    rescue Exception => err
      FileUtils.rm_rf output_dir
      msg = "could not create '#{name}'"
      msg << " in directory '#{output_dir}'" if name != output_dir
      abort msg
    end
  end
def create abort "'#{output_dir}' already exists" if test ?e , output_dir begin files_to_copy . each { | fn | cp fn } pwd = File . expand_path ( FileUtils . pwd ) msg = "created '#{name}'" msg << " in directory '#{output_dir}'" if name != output_dir STDOUT . puts msg if test ( ?f , File . join ( output_dir , 'Rakefile' ) ) begin FileUtils . cd output_dir system "rake manifest:create 2>&1 > #{::Bones::DEV_NULL}" STDOUT . puts "now you need to fix these files" system "rake notes" ensure FileUtils . cd pwd end end rescue Exception => err FileUtils . rm_rf output_dir msg = "could not create '#{name}'" msg << " in directory '#{output_dir}'" if name != output_dir abort msg end end
Create a new project from the bones/data project template.
Create a new project from the bones / data project template .
# see if the directory already exists