Sha256: 754248c24425f099f356fa1280a4a2c90da11df978fdfeb8436b89e1c3d30e12

Contents?: true

Size: 998 Bytes

Versions: 40

Compression:

Stored size: 998 Bytes

Contents

#!/usr/bin/env ruby
unless File.exist?(Dir.pwd + '/Gemfile') && /gem.*shopapp/.match?(File.read(Dir.pwd + '/Gemfile'))
  puts "You can only call shop macro from a shopapp root folder"
  return
end

deployment_targets = `rake shopapp:targets`.strip
commands = %w(console rake tail bash run pulldb fetchdb restoredb help revs)
if ARGV.count == 2 && ARGV[0] == 'help' && (commands.include? ARGV[1])
  cmd = "rake shopapp:help cmd=#{ARGV[1]}"
elsif ARGV.count < 2 ||
   !(deployment_targets.split(', ').include? ARGV[0]) ||
   !(commands.include? ARGV[1])
  puts "Usage: shop [TARGET] COMMAND [parameters]"
  puts "Targets: #{deployment_targets}."
  puts "Commands: #{commands.join ', '}."
  puts "No target for help, mandatory for all others."
  puts "For more info on specific command: shop help COMMAND."
  return
else
  parameters = ARGV[2..-1].join ' '
  parameters = %( "#{parameters}") if parameters.to_s.length > 0
  cmd = "target=#{ARGV[0]} rake shopapp:#{ARGV[1]}#{parameters}"
end

exec cmd

Version data entries

40 entries across 40 versions & 1 rubygems

Version Path
shopapp-0.77.07 bin/shop
shopapp-0.76.06 bin/shop
shopapp-0.76.05 bin/shop
shopapp-0.76.04 bin/shop
shopapp-0.75.03 bin/shop
shopapp-0.75.02 bin/shop
shopapp-0.73.02 bin/shop
shopapp-0.3.76 bin/shop
shopapp-0.2.75 bin/shop
shopapp-0.2.74 bin/shop
shopapp-0.2.73 bin/shop
shopapp-0.2.72 bin/shop
shopapp-0.2.71 bin/shop
shopapp-0.2.70 bin/shop
shopapp-0.2.69 bin/shop
shopapp-0.2.68 bin/shop
shopapp-0.2.67 bin/shop
shopapp-0.2.66 bin/shop
shopapp-0.2.65 bin/shop
shopapp-0.2.64 bin/shop