Sha256: 99b64d7fde8ae39c1dd3c9899d698f3cf44115f4bf22631e9071f92b0fcdeab5

Contents?: true

Size: 1.02 KB

Versions: 1

Compression:

Stored size: 1.02 KB

Contents

#!/usr/bin/env ruby

$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), *%w(.. lib)))

require "optparse"
require "caravan"

options = {}
option_parser = OptionParser.new do |opts|
  opts.banner = "Caravan #{Caravan::VERSION}\nCopyright (c) David Zhang 2017\n"
  opts.separator ""

  opts.on("-s SOURCE_PATH", "--source SOURCE_PATH", "Source path") do |value|
    options[:src] = value
  end

  opts.on("-d DEST_PATH", "--dest DEST_PATH", "Destination path") do |value|
    options[:dst] = value
  end

  opts.on("-m DEPLOY_MODE", "--mode DEPLOY_MODE", "Deploy mode") do |value|
    options[:mode] = value || "shell"
  end

  opts.on("-i IGNORE_FILES", "--ignore IGNORE_FILES", "Ignore files") do |value|
    options[:ignore] = value || "\.(git|svn)$"
  end

  options[:debug] = false
  opts.on("-b", "--debug", "Debug mode") do
    options[:debug] = true
  end

  opts.on_tail("--version", "Show version") do
    puts Caravan::VERSION
    exit
  end
end.parse!(ARGV)

if options.key?(:src) && options.key?(:dst)
    Caravan.start(options)
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
caravan-0.3.1 exe/caravan