From bf3adec7271b50a9217f02b2f54186a975e6e08a Mon Sep 17 00:00:00 2001 From: mmcwilliams Date: Sun, 24 Feb 2019 08:22:59 -0500 Subject: [PATCH] Interpret mscript commands on input. --- cli/index.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/cli/index.js b/cli/index.js index 598e787..d97aa50 100644 --- a/cli/index.js +++ b/cli/index.js @@ -6,8 +6,9 @@ const moment = require('moment') const delay = require('delay') //const intval = require('intval') -const arduino = require('arduino') -const mscript = require('mscript') +//const arduino = require('arduino') +const Mscript = require('mscript') +const mscript = new Mscript() const dev = require('device') let log @@ -20,8 +21,10 @@ async function command () { return new Promise ((resolve, reject) => { return readline.question(`Input:`, (str) => { log.info(str) + console.dir(mscript.interpret(str)) + //interpret string - readline.close() + //readline.close() return resolve(true) }) }) @@ -45,6 +48,7 @@ async function live () { async function main (arg) { log = require('log')(arg) log.info('mcopy-cli') + await live() } program