Sha256: 3f69598de644cc70b40fea76419ea3d08b54fb83211dc0ace919e41e3b80bddc
Contents?: true
Size: 1.65 KB
Versions: 3
Compression:
Stored size: 1.65 KB
Contents
#!/usr/bin/env ruby require 'optparse' require 'methadone' require_relative '../motion-prime/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) else help end 0 end def self.help info "Command line tools for MotionPrime" info "Commands:" info " new <appname>" info " Creates a new MotionPrime app from a template." end def self.create(name) return puts "Usage: prime new <appname>" unless name.to_s.length > 0 info "Creating new MotionPrime iOS app: #{name}" if false sh "motion create #{name} --template=git://github.com/droidlabs/motion-prime.git" else clone_template sh "motion create #{name} --template=motion-prime" end info "Command: bundle instal" sh "cd ./#{name}; bundle install" info "Command: pod setup" sh "cd ./#{name}; pod setup" info "Command: rake pod:install" sh "cd ./#{name}; rake pod:install" end def self.home_path ENV['HOME'].split('/')[0..2].join('/') end def self.repo_url "git://github.com/droidlabs/motion-prime.git" end def self.clone_template path = File.expand_path(File.join(home_path, 'Library/RubyMotion/template', 'motion-prime')) git_clone(path) end def self.git_clone(path) if File.exist?(path) system("git --work-tree=#{path} --git-dir=#{path}/.git pull origin master") else system("git clone #{repo_url} #{path}") end end description "Command line tools for MotionPrime" arg :command arg :opt, :optional version MotionPrime::VERSION go! end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
motion-prime-0.7.2 | bin/prime |
motion-prime-0.7.1 | bin/prime |
motion-prime-0.7.0 | bin/prime |