[command] Make the device-console command work again.

This commit is contained in:
Eloy Durán
2014-01-17 17:00:57 +01:00
parent b65a05e142
commit a2f130f0b3
2 changed files with 21 additions and 16 deletions

View File

@@ -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?