From 0aab6c8739125d4bbf558154dbc5dd897eeb1c20 Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Fri, 1 Jun 2018 03:13:04 -0600 Subject: [PATCH] update grant message --- remote.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/remote.js b/remote.js index 676b6ad..90f73fe 100644 --- a/remote.js +++ b/remote.js @@ -206,6 +206,17 @@ function run(state) { }); } + function displayGrants(grants) { + // TODO sortingHat.print(); + console.log(""); + console.log("Connect to your device by any of the following means:"); + console.log(""); + grants.forEach(function (arr) { + console.log('\t' + arr[0] + '://' + arr[1] + (arr[2] ? (':' + arr[2]) : '')); + }); + console.log(""); + } + var connCallback; var packerHandlers = { @@ -252,6 +263,11 @@ function run(state) { err = { message: 'unknown command "'+cmd[1]+'"', code: 'E_UNKNOWN_COMMAND' }; } + if (cmd[1] === 'grant') { + displayGrants(cmd[2]); + return; + } + wsHandlers.sendMessage(Packer.pack(null, [-cmd[0], err], 'control')); }