Interpret mscript commands on input.

This commit is contained in:
mmcwilliams 2019-02-24 08:22:59 -05:00
parent 58ade0518e
commit bf3adec727
1 changed files with 7 additions and 3 deletions

View File

@ -6,8 +6,9 @@ const moment = require('moment')
const delay = require('delay') const delay = require('delay')
//const intval = require('intval') //const intval = require('intval')
const arduino = require('arduino') //const arduino = require('arduino')
const mscript = require('mscript') const Mscript = require('mscript')
const mscript = new Mscript()
const dev = require('device') const dev = require('device')
let log let log
@ -20,8 +21,10 @@ async function command () {
return new Promise ((resolve, reject) => { return new Promise ((resolve, reject) => {
return readline.question(`Input:`, (str) => { return readline.question(`Input:`, (str) => {
log.info(str) log.info(str)
console.dir(mscript.interpret(str))
//interpret string //interpret string
readline.close() //readline.close()
return resolve(true) return resolve(true)
}) })
}) })
@ -45,6 +48,7 @@ async function live () {
async function main (arg) { async function main (arg) {
log = require('log')(arg) log = require('log')(arg)
log.info('mcopy-cli') log.info('mcopy-cli')
await live()
} }
program program