mirror of
https://github.com/zhigang1992/ProMotion.git
synced 2026-05-30 00:30:40 +08:00
46 lines
954 B
Ruby
Executable File
46 lines
954 B
Ruby
Executable File
#!/usr/bin/env ruby
|
|
|
|
require 'optparse'
|
|
require 'methadone'
|
|
require 'ProMotion/version'
|
|
|
|
class App
|
|
include Methadone::Main
|
|
include Methadone::CLILogging
|
|
include Methadone::SH
|
|
|
|
main do |command, opt|
|
|
case command.to_sym
|
|
when :new then create(opt)
|
|
when :help then show_help
|
|
else show_help
|
|
end
|
|
|
|
0 # Good!
|
|
end
|
|
|
|
def self.show_help
|
|
info "promotion - Command line tools for ProMotion."
|
|
info "By Jamon Holmgren"
|
|
info ""
|
|
info "Commands:"
|
|
info " new <appname>"
|
|
info " Creates a new ProMotion app from a template."
|
|
end
|
|
|
|
def self.create(name)
|
|
return puts "Usage: promotion new <appname>" unless name.to_s.length > 0
|
|
info "Creating new ProMotion iOS app #{name}"
|
|
sh "motion create --template=git://github.com/jamonholmgren/promotion-template.git #{name}"
|
|
end
|
|
|
|
description "Command line for ProMotion."
|
|
|
|
arg :command
|
|
arg :opt, :optional
|
|
|
|
version ProMotion::VERSION
|
|
|
|
go!
|
|
end
|