mirror of
https://github.com/zhigang1992/RubyMotion.git
synced 2026-04-18 12:13:28 +08:00
[command] Make the device-console command work again.
This commit is contained in:
@@ -45,29 +45,29 @@ module Motion; module Project
|
||||
end
|
||||
|
||||
def self.name
|
||||
warn "The usage of `Motion::Project::Command.name` is deprecated use the " \
|
||||
"`Motion::Project::Command.command` method instead. " \
|
||||
warn "[!] The usage of `Motion::Project::Command.name` is deprecated " \
|
||||
"use the `Motion::Project::Command.command` method instead. " \
|
||||
"(Called from: #{caller.first})"
|
||||
command
|
||||
end
|
||||
|
||||
def self.name=(name)
|
||||
warn "The usage of `Motion::Project::Command.name=` is deprecated use the " \
|
||||
"`Motion::Project::Command.command=` method instead. " \
|
||||
warn "[!] The usage of `Motion::Project::Command.name=` is deprecated " \
|
||||
"use the `Motion::Project::Command.command=` method instead. " \
|
||||
"(Called from: #{caller.first})"
|
||||
self.command = name
|
||||
end
|
||||
|
||||
def self.help
|
||||
warn "The usage of `Motion::Project::Command.help` is deprecated use the " \
|
||||
"`Motion::Project::Command.summary` method instead. " \
|
||||
warn "[!] The usage of `Motion::Project::Command.help` is deprecated " \
|
||||
"use the `Motion::Project::Command.summary` method instead. " \
|
||||
"(Called from: #{caller.first})"
|
||||
summary
|
||||
end
|
||||
|
||||
def self.help=(summary)
|
||||
warn "The usage of `Motion::Project::Command.help=` is deprecated use the " \
|
||||
"`Motion::Project::Command.summary=` method instead. " \
|
||||
warn "[!] The usage of `Motion::Project::Command.help=` is deprecated " \
|
||||
"use the `Motion::Project::Command.summary=` method instead. " \
|
||||
"(Called from: #{caller.first})"
|
||||
self.summary = summary
|
||||
end
|
||||
@@ -80,7 +80,7 @@ module Motion; module Project
|
||||
require 'motion/project/command/activate'
|
||||
require 'motion/project/command/changelog'
|
||||
#require 'motion/project/command/create'
|
||||
#require 'motion/project/command/device_console'
|
||||
require 'motion/project/command/device_console'
|
||||
require 'motion/project/command/ri'
|
||||
require 'motion/project/command/support'
|
||||
require 'motion/project/command/update'
|
||||
|
||||
@@ -22,15 +22,20 @@
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
module Motion; module Project
|
||||
class DeviceConsoleCommand < Command
|
||||
self.name = 'device:console'
|
||||
self.help = 'Print the device console logs'
|
||||
class DeprecatedDeviceConsole < Command
|
||||
self.command = 'device:console'
|
||||
|
||||
def run(args)
|
||||
unless args.empty?
|
||||
die "Usage: motion device:console"
|
||||
end
|
||||
def run
|
||||
warn "[!] The usage of the `device:console` command is deprecated" \
|
||||
"use the `device-console` command instead."
|
||||
DeviceConsole.run([])
|
||||
end
|
||||
end
|
||||
|
||||
class DeviceConsole < Command
|
||||
self.summary = 'Print iOS device logs'
|
||||
|
||||
def run
|
||||
deploy = File.join(File.dirname(__FILE__), '../../../../bin/ios/deploy')
|
||||
devices = `\"#{deploy}\" -D`.strip.split(/\n/)
|
||||
if devices.empty?
|
||||
|
||||
Reference in New Issue
Block a user