Sha256: b4e20611b5d01fe576c75b87c15b5dd3d1bbf92d3b699ea1920f5d6e84326baa

Contents?: true

Size: 1 KB

Versions: 1

Compression:

Stored size: 1 KB

Contents

#!/usr/bin/env ruby

require "bundler/setup"
require 'seeit'
require "json"
require 'optparse'

options = {}
OptionParser.new do |opts|
  opts.banner = "Usage: build_version"

  opts.on("-pPROJECT_DIR", "--project-dir=PROJECT_DIR", "Project directory with settings.json") do |project_dir|
    options[:project_dir] = project_dir
  end
  opts.on("-bVERSION_NAME", "--build-version=VERSION_NAME", "Mark the version of your screenshots (defaults to today's date)") do |build_version|
    options[:build_version] = build_version
  end
  opts.on("-h", "--help", "Prints this help") do
    puts opts
    exit
  end

end.parse!

# raise required items
raise OptionParser::MissingArgument if options[:project_dir].nil?

build_version = options[:build_version]
build_version = Date.today.strftime("%Y-%m-%d") if options[:build_version].nil?

# read and parse config file
file        = File.read "#{options[:project_dir]}/settings.json"
site_config = JSON.parse(file)

b = Seeit::Builder.new(site_config, options[:build_version])
b.build

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
seeit-0.1.0 bin/build_version