Sha256: f16eb9a99cb78a51837b727934f64d136de8168131a8f3b65bbccc57ac507d96

Contents?: true

Size: 1.36 KB

Versions: 4

Compression:

Stored size: 1.36 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

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

4 entries across 4 versions & 1 rubygems

Version Path
reap-9.3.1 bin/reap-init
reap-9.3.3 bin/reap-init
reap-9.3.4 bin/reap-init
reap-9.3.5 bin/reap-init