Sha256: e46b791569bbba0da147cce02097a48e32a715aa9fbf4d6e4a1bc5c3ec3e19f5

Contents?: true

Size: 1.46 KB

Versions: 1

Compression:

Stored size: 1.46 KB

Contents

#!/usr/bin/env ruby

# THIS IS PRETTY SIMPLISTIC AT THE MOMENT.
# BUT I JUST WANTED TO GET SOMETHING FUNCITONAL
# GOING FOR NOW. WILL FIX IT UP LATER.

require 'reap/utilities'

include Reap::Utilities

HELP = <<-END
Usage: #{File.basename($0)} [options]
END

if ARGV.include?('--help')
  puts HELP
  exit
end

def dryrun?
  ARGV.include?('--dryrun')
end

def force?
  ARGV.include?('--force')
end

#unless Dir['**/*'].empty?
#  puts Dir.pwd
#  ans = ask("WARNING: Directory is not empty. Continue?", 'Yn')
#  case ans.downcase
#  when 'y', 'yes', ''
#    puts
#  else
#    puts "Reap initialization aborted."
#    exit 0
#  end
#end

if defined?(::Library) and Library['reap']
  datadir = Library['reap'].datadir
else
  datadir = File.join(Config::CONFIG['datadir'])
end
datadir = File.join(datadir, 'reap')
initdir = File.join(datadir, 'init')

unless File.exist?(initdir)
  puts "Error: Can't locate scaffolding -- #{initdir}"
  exit 0
end

puts "Creating Reap initialization files..."
puts

if File.exist?('.reap') && !force?
  puts "  SKIPPED: .reap"
else
  file = File.join(initdir, '.reap')
  cp(file, './')
  puts "  CREATED: .reap"
end

if File.exist?('meta/project.yaml') && !force?
  puts "  SKIPPED: meta/project.yaml"
else
  file = File.join(initdir, 'meta/project.yaml')
  mkdir_p('meta')
  cp(file, 'meta/')
  puts "  CREATED: meta/project.yaml"
end

puts
puts "Edit the .reap and meta files to suit your project."
puts "You can run reap-scaffold to get a full project scaffolding."

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
reap-9.4.0 bin/reap-init