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