Sha256: d65b60642ab5e164f8378157a3a97bb05a3c7e1caef46b24779350a4c6c7f265

Contents?: true

Size: 1 KB

Versions: 7

Compression:

Stored size: 1 KB

Contents

#!/usr/bin/env ruby

require 'optparse'
require 'brick_and_mortar'

options = {}
OptionParser.new do |opts|
  opts.banner = "Usage: #{__FILE__} [options]"

  opts.on("-h", "--help", "Show this message") do
    puts opts
    exit
  end

  options[:brickfile] = File.join(Dir.pwd, 'Brickfile')
  opts.on(
    "-f",
    "--brickfile [Brickfile name]",
    "Lay the bricks specified in this Brickfile. Defaults to \"#{options[:brickfile]}\""
  ) do |x|
    options[:brickfile] = x unless x.nil?
  end

  options[:brick_store] = BrickAndMortar::Project::DEFAULT_BRICK_STORE
  opts.on(
    "-s",
    "--store [brick store path]",
    "Store bricks here. Defaults to \"#{options[:brick_store]}\""
  ) do |x|
    options[:brick_store] = x unless x.nil?
  end
end.parse!

unless File.file?(options[:brickfile])
  puts "#{options[:brickfile]} does not exist. Please create a Brickfile before trying to lay bricks for this project."
  exit 1
end
project = BrickAndMortar::Project.new options[:brickfile], options[:brick_store]
project.lay!

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
brick_and_mortar-0.1.2 bin/mortar
brick_and_mortar-0.1.1 bin/mortar
brick_and_mortar-0.1.0 bin/mortar
brick_and_mortar-0.0.4 bin/mortar
brick_and_mortar-0.0.3 bin/mortar
brick_and_mortar-0.0.2 bin/mortar
brick_and_mortar-0.0.1 bin/mortar