From 84671eb9b6c972e9c537f6476197e00f113f8b29 Mon Sep 17 00:00:00 2001 From: Hyojin Kim Date: Tue, 12 Jan 2021 12:15:13 +0900 Subject: [PATCH 1/6] Update verbose mode --- lib/appLaunchHelper.js | 29 ++++++++++++++++++++--------- lib/cli.js | 27 ++++++++++++++++++++------- lib/deviceConnectHelper.js | 8 +++++--- lib/util.js | 1 + lib/watchHelper.js | 30 +++++++++++++++++------------- 5 files changed, 63 insertions(+), 32 deletions(-) diff --git a/lib/appLaunchHelper.js b/lib/appLaunchHelper.js index e64f950..60a6291 100644 --- a/lib/appLaunchHelper.js +++ b/lib/appLaunchHelper.js @@ -22,8 +22,11 @@ module.exports = { )}" "${appInstallPath}"`; const APP_INSTALL_COMMAND = `${util.TOOLS_SDB_PATH} -s ${deviceName} shell 0 vd_appinstall ${hostAppName} ${appInstallPath}${WITS_PACKAGE}`; - execSync(WGT_FILE_PUSH_COMMAND, { silent: true }); - const result = execSync(APP_INSTALL_COMMAND).toString(); + console.log(util.ISSILENT); + execSync(WGT_FILE_PUSH_COMMAND, { silent: util.ISSILENT }); + const result = execSync(APP_INSTALL_COMMAND, { + silent: util.ISSILENT + }).toString(); if (result.includes('failed[')) { logger.error(chalk.red(`\nFailed to install Wits`)); @@ -33,7 +36,7 @@ module.exports = { unInstallPackage: (deviceName, hostAppName) => { const APP_UNINSTALL_COMMAND = `${util.TOOLS_SDB_PATH} -s ${deviceName} shell 0 vd_appuninstall ${hostAppName}`; const result = execSync(APP_UNINSTALL_COMMAND, { - silent: true + silent: util.ISSILENT }).toString(); if (result.includes('failed[')) { @@ -43,7 +46,9 @@ module.exports = { launchApp: (deviceName, hostAppId) => { const APP_LAUNCH_COMMAND = `${util.TOOLS_SDB_PATH} -s ${deviceName} shell 0 was_execute ${hostAppId}`; - const result = execSync(APP_LAUNCH_COMMAND).toString(); + const result = execSync(APP_LAUNCH_COMMAND, { + silent: util.ISSILENT + }).toString(); if (result === null || result.includes('failed[')) { throw new Error( 'Failed to launchApp. Please check the application is already installed on the Target.' @@ -55,8 +60,12 @@ module.exports = { const APP_LAUNCH_DEBUG_MODE_COMMAND_TIMEOUT = `${APP_LAUNCH_DEBUG_MODE_COMMAND} 300`; const result = - execSync(APP_LAUNCH_DEBUG_MODE_COMMAND).toString() || - execSync(APP_LAUNCH_DEBUG_MODE_COMMAND_TIMEOUT).toString(); + execSync(APP_LAUNCH_DEBUG_MODE_COMMAND, { + silent: util.ISSILENT + }).toString() || + execSync(APP_LAUNCH_DEBUG_MODE_COMMAND_TIMEOUT, { + silent: util.ISSILENT + }).toString(); if (result === null || result.includes('failed')) { throw new Error( 'Failed to launchDebugMode. Please check the application is already installed on the Target.' @@ -85,17 +94,19 @@ module.exports = { }, terminateApp: (deviceName, hostAppId) => { const APP_TERMINATE_COMMAND = `${util.TOOLS_SDB_PATH} -s ${deviceName} shell 0 was_kill ${hostAppId}`; - execSync(APP_TERMINATE_COMMAND, { silent: true }); + execSync(APP_TERMINATE_COMMAND, { silent: util.ISSILENT }); } }; function setPortForward(deviceName, port) { const LOCAL_HOST = '127.0.0.1'; execSync( - `${util.TOOLS_SDB_PATH} -s ${deviceName} forward --remove tcp:${port}` + `${util.TOOLS_SDB_PATH} -s ${deviceName} forward --remove tcp:${port}`, + { silent: util.ISSILENT } ); execSync( - `${util.TOOLS_SDB_PATH} -s ${deviceName} forward tcp:${port} tcp:${port}` + `${util.TOOLS_SDB_PATH} -s ${deviceName} forward tcp:${port} tcp:${port}`, + { silent: util.ISSILENT } ); try { launchChrome(LOCAL_HOST + ':' + port); diff --git a/lib/cli.js b/lib/cli.js index 2c3c0c6..c0d062d 100644 --- a/lib/cli.js +++ b/lib/cli.js @@ -15,29 +15,34 @@ process.on('SIGINT', () => { util.displayBanner(); -program.version(`wits v${package.version}`); -program.option('-i, --init', 'Set configuration for running WITs'); +program.version(`wits v${package.version}`, '-v, --version', 'WITs version'); +program.allowUnknownOption(); +program.option('-i, --init', 'Set configuration for running WITs.'); program.option( '-c, --certificate', - 'Generate a certification for signing Tizen web app' + 'Generate a certification for signing Tizen web app. You can set a log level for debugging. ex) wits -c --verbose' ); program.option( '-s, --start [deviceIp]', - 'Install, launch app and enable live reload feature in a sequence. ex) wits -s / wits -s deviceIp=192.168.250.250' + 'Install, launch app and enable live reload feature in a sequence. ex) wits -s / wits -s deviceIp=192.168.250.250 / wits -s --verbose' ); program.option( '-w, --watch [deviceIp]', - 'Launch app and enable live reload feature without reinstalling. ex) wits -w / wits -w deviceIp=192.168.250.250' + 'Launch app and enable live reload feature without reinstalling. ex) wits -w / wits -w deviceIp=192.168.250.250 / wits -w --verbose' ); - program.parse(process.argv); +const isVerbose = checkVerbose(process.argv); +if (isVerbose) { + util.ISSILENT = false; +} +console.log(isVerbose, util.ISSILENT); if (program.init) { const initCommand = require('../command/init.js'); initCommand.run(); } else if (program.certificate) { const certificateCommand = require('../command/certificate.js'); - certificateCommand.run(); + certificateCommand.run(program.certificate); } else if (program.start) { const startCommand = require('../command/start.js'); startCommand.run(program.start); @@ -47,3 +52,11 @@ if (program.init) { } else { program.help(); } + +function checkVerbose(arguments) { + const lastIndex = arguments.length - 1; + if (arguments[lastIndex] === '--verbose') { + return true; + } + return false; +} diff --git a/lib/deviceConnectHelper.js b/lib/deviceConnectHelper.js index 287ed61..3d31499 100644 --- a/lib/deviceConnectHelper.js +++ b/lib/deviceConnectHelper.js @@ -28,7 +28,9 @@ module.exports = { if (deviceIpAddress !== EMULATOR_IP) { logger.log(`connect to....${deviceIpAddress}`); const CONNECT_TV_COMMAND = `${util.TOOLS_SDB_PATH} connect ${deviceIpAddress}:${TV_CONNECT_PORT}`; - const connectResult = execSync(CONNECT_TV_COMMAND).toString(); + const connectResult = execSync(CONNECT_TV_COMMAND, { + silent: util.ISSILENT + }).toString(); if (connectResult.includes('connected')) { logger.log(`Success to connect ${deviceIpAddress}`); @@ -67,7 +69,7 @@ module.exports = { const capability = execSync( `${util.TOOLS_SDB_PATH} -s ${deviceName} capability`, - { silent: true } + { silent: util.ISSILENT } ) .toString() .split('\n'); @@ -83,7 +85,7 @@ module.exports = { function getConnectedDeviceList(deviceIpAddress) { const devices = execSync(`${util.TOOLS_SDB_PATH} devices`, { - silent: true + silent: util.ISSILENT }).toString(); let devicesInfo = []; let deviceNameList = []; diff --git a/lib/util.js b/lib/util.js index 8b4a690..8bd247c 100644 --- a/lib/util.js +++ b/lib/util.js @@ -19,6 +19,7 @@ module.exports = { RESOURCE_PATH: path.resolve(__dirname, '../', 'resource'), TOOLS_SDB_PATH: '', PLATFORM: platform, + ISSILENT: true, initTools: async () => { module.exports.TOOLS_SDB_PATH = await tools.getSdbPath(); }, diff --git a/lib/watchHelper.js b/lib/watchHelper.js index 436bc82..76d0c74 100644 --- a/lib/watchHelper.js +++ b/lib/watchHelper.js @@ -164,7 +164,7 @@ function pushFile(baseAppPath, hostAppPath, filesInfo) { const CONTENT_FILE_PUSH_COMMAND = `${util.TOOLS_SDB_PATH} -s ${deviceName} push "${filePath}" "${hostAppPath}${fileName}"`; const pushResult = exec(CONTENT_FILE_PUSH_COMMAND, { async: true, - silent: true + silent: util.ISSILENT }); pushResult.stderr.on('data', data => { const COMPATIBILITY_ERROR = 'version compatibility problems'; @@ -225,19 +225,23 @@ function pushUpdated(basePath, destPath, filePath) { } } const UPDATE_FILE_PUSH_COMMAND = `${util.TOOLS_SDB_PATH} -s ${deviceName} push "${fileFullPath}" "${destPath}${filePath}"`; - exec(UPDATE_FILE_PUSH_COMMAND, (code, stdout, stderr) => { - if (stderr) { - const COMPATIBILITY_ERROR = 'version compatibility problems'; - if (!stderr.includes(COMPATIBILITY_ERROR)) { - logger.log(`Failed ${stderr}`); - util.exit(); + exec( + UPDATE_FILE_PUSH_COMMAND, + { silent: util.ISSILENT }, + (code, stdout, stderr) => { + if (stderr) { + const COMPATIBILITY_ERROR = 'version compatibility problems'; + if (!stderr.includes(COMPATIBILITY_ERROR)) { + logger.log(`Failed ${stderr}`); + util.exit(); + } + } + logger.log(`Program output : ${stdout}`); + if (stdout.includes('file(s) pushed')) { + mediator.emit('changed'); } } - logger.log(`Program output : ${stdout}`); - if (stdout.includes('file(s) pushed')) { - mediator.emit('changed'); - } - }); + ); } function emitRemoved(basePath, destPath, filePath) { @@ -271,7 +275,7 @@ function pushFsWrapperFile(hostAppPath) { const WRAPPER_FILE_PUSH_COMMAND = `${util.TOOLS_SDB_PATH} -s ${deviceName} push "${WRAPPER_FILE_PATH}" "${hostAppPath}/${WRAPPER_FILE}"`; exec(WRAPPER_FILE_PUSH_COMMAND, { async: true, - silent: true + silent: util.ISSILENT }); } From 1f7278d45634b205fde986d9958d345fde7c7e3f Mon Sep 17 00:00:00 2001 From: Hyojin Kim Date: Tue, 12 Jan 2021 17:09:40 +0900 Subject: [PATCH 2/6] Add verbose --- lib/appLaunchHelper.js | 66 +++++++++++++++++++++++++++----------- lib/cli.js | 6 +--- lib/deviceConnectHelper.js | 16 ++++++--- lib/util.js | 7 +++- lib/watchHelper.js | 17 +++++++--- 5 files changed, 77 insertions(+), 35 deletions(-) diff --git a/lib/appLaunchHelper.js b/lib/appLaunchHelper.js index 60a6291..82fc168 100644 --- a/lib/appLaunchHelper.js +++ b/lib/appLaunchHelper.js @@ -22,13 +22,19 @@ module.exports = { )}" "${appInstallPath}"`; const APP_INSTALL_COMMAND = `${util.TOOLS_SDB_PATH} -s ${deviceName} shell 0 vd_appinstall ${hostAppName} ${appInstallPath}${WITS_PACKAGE}`; - console.log(util.ISSILENT); - execSync(WGT_FILE_PUSH_COMMAND, { silent: util.ISSILENT }); - const result = execSync(APP_INSTALL_COMMAND, { - silent: util.ISSILENT - }).toString(); + const pushResult = execSync(WGT_FILE_PUSH_COMMAND, { + encoding: 'utf-8', + stdio: 'pipe' + }); + util.displayOutput(pushResult); - if (result.includes('failed[')) { + const installResult = execSync(APP_INSTALL_COMMAND, { + encoding: 'utf-8', + stdio: 'pipe' + }); + util.displayOutput(installResult); + + if (installResult.includes('failed[')) { logger.error(chalk.red(`\nFailed to install Wits`)); util.exit(); } @@ -36,8 +42,10 @@ module.exports = { unInstallPackage: (deviceName, hostAppName) => { const APP_UNINSTALL_COMMAND = `${util.TOOLS_SDB_PATH} -s ${deviceName} shell 0 vd_appuninstall ${hostAppName}`; const result = execSync(APP_UNINSTALL_COMMAND, { - silent: util.ISSILENT - }).toString(); + encoding: 'utf-8', + stdio: 'pipe' + }); + util.displayOutput(result); if (result.includes('failed[')) { logger.warn(`\n[warning] Failed to uninstall Wits`); @@ -47,8 +55,11 @@ module.exports = { const APP_LAUNCH_COMMAND = `${util.TOOLS_SDB_PATH} -s ${deviceName} shell 0 was_execute ${hostAppId}`; const result = execSync(APP_LAUNCH_COMMAND, { - silent: util.ISSILENT - }).toString(); + encoding: 'utf-8', + stdio: 'pipe' + }); + util.displayOutput(result); + if (result === null || result.includes('failed[')) { throw new Error( 'Failed to launchApp. Please check the application is already installed on the Target.' @@ -61,11 +72,15 @@ module.exports = { const result = execSync(APP_LAUNCH_DEBUG_MODE_COMMAND, { - silent: util.ISSILENT - }).toString() || + encoding: 'utf-8', + stdio: 'pipe' + }) || execSync(APP_LAUNCH_DEBUG_MODE_COMMAND_TIMEOUT, { - silent: util.ISSILENT - }).toString(); + encoding: 'utf-8', + stdio: 'pipe' + }); + util.displayOutput(result); + if (result === null || result.includes('failed')) { throw new Error( 'Failed to launchDebugMode. Please check the application is already installed on the Target.' @@ -94,20 +109,33 @@ module.exports = { }, terminateApp: (deviceName, hostAppId) => { const APP_TERMINATE_COMMAND = `${util.TOOLS_SDB_PATH} -s ${deviceName} shell 0 was_kill ${hostAppId}`; - execSync(APP_TERMINATE_COMMAND, { silent: util.ISSILENT }); + const result = execSync(APP_TERMINATE_COMMAND, { + encoding: 'utf-8', + stdio: 'pipe' + }); + util.displayOutput(result); } }; function setPortForward(deviceName, port) { const LOCAL_HOST = '127.0.0.1'; - execSync( + const removeResult = execSync( `${util.TOOLS_SDB_PATH} -s ${deviceName} forward --remove tcp:${port}`, - { silent: util.ISSILENT } + { + encoding: 'utf-8', + stdio: 'pipe' + } ); - execSync( + util.displayOutput(removeResult); + + const tcpResult = execSync( `${util.TOOLS_SDB_PATH} -s ${deviceName} forward tcp:${port} tcp:${port}`, - { silent: util.ISSILENT } + { + encoding: 'utf-8', + stdio: 'pipe' + } ); + util.displayOutput(tcpResult); try { launchChrome(LOCAL_HOST + ':' + port); } catch (e) { diff --git a/lib/cli.js b/lib/cli.js index c0d062d..cf0a51c 100644 --- a/lib/cli.js +++ b/lib/cli.js @@ -31,11 +31,7 @@ program.option( 'Launch app and enable live reload feature without reinstalling. ex) wits -w / wits -w deviceIp=192.168.250.250 / wits -w --verbose' ); program.parse(process.argv); -const isVerbose = checkVerbose(process.argv); -if (isVerbose) { - util.ISSILENT = false; -} -console.log(isVerbose, util.ISSILENT); +util.ISVERVOSE = checkVerbose(process.argv); if (program.init) { const initCommand = require('../command/init.js'); diff --git a/lib/deviceConnectHelper.js b/lib/deviceConnectHelper.js index 3d31499..1f70f23 100644 --- a/lib/deviceConnectHelper.js +++ b/lib/deviceConnectHelper.js @@ -29,8 +29,10 @@ module.exports = { logger.log(`connect to....${deviceIpAddress}`); const CONNECT_TV_COMMAND = `${util.TOOLS_SDB_PATH} connect ${deviceIpAddress}:${TV_CONNECT_PORT}`; const connectResult = execSync(CONNECT_TV_COMMAND, { - silent: util.ISSILENT - }).toString(); + encoding: 'utf-8', + stdio: 'pipe' + }); + util.displayOutput(connectResult); if (connectResult.includes('connected')) { logger.log(`Success to connect ${deviceIpAddress}`); @@ -69,10 +71,11 @@ module.exports = { const capability = execSync( `${util.TOOLS_SDB_PATH} -s ${deviceName} capability`, - { silent: util.ISSILENT } + { stdio: 'pipe' } ) .toString() .split('\n'); + capability.forEach(value => { if (value.indexOf('sdk_toolpath') !== -1) { appInstallPath = @@ -85,8 +88,11 @@ module.exports = { function getConnectedDeviceList(deviceIpAddress) { const devices = execSync(`${util.TOOLS_SDB_PATH} devices`, { - silent: util.ISSILENT - }).toString(); + encoding: 'utf-8', + stdio: 'pipe' + }); + util.displayOutput(devices); + let devicesInfo = []; let deviceNameList = []; if (!devices.includes('offline')) { diff --git a/lib/util.js b/lib/util.js index 8bd247c..abd84ba 100644 --- a/lib/util.js +++ b/lib/util.js @@ -19,7 +19,7 @@ module.exports = { RESOURCE_PATH: path.resolve(__dirname, '../', 'resource'), TOOLS_SDB_PATH: '', PLATFORM: platform, - ISSILENT: true, + ISVERVOSE: false, initTools: async () => { module.exports.TOOLS_SDB_PATH = await tools.getSdbPath(); }, @@ -136,6 +136,11 @@ module.exports = { return data.replace(regExp.COMMENT, ''); }, + displayOutput: logs => { + if (module.exports.ISVERVOSE === true) { + logger.log(logs); + } + }, getSocketPort: () => { const REMIND_SOCKET_PORT_LEN = 3; const MAX_DIGIT = 9; diff --git a/lib/watchHelper.js b/lib/watchHelper.js index 76d0c74..3687a1c 100644 --- a/lib/watchHelper.js +++ b/lib/watchHelper.js @@ -164,8 +164,11 @@ function pushFile(baseAppPath, hostAppPath, filesInfo) { const CONTENT_FILE_PUSH_COMMAND = `${util.TOOLS_SDB_PATH} -s ${deviceName} push "${filePath}" "${hostAppPath}${fileName}"`; const pushResult = exec(CONTENT_FILE_PUSH_COMMAND, { async: true, - silent: util.ISSILENT + encoding: 'utf-8', + stdio: 'pipe' }); + util.displayOutput(pushResult); + pushResult.stderr.on('data', data => { const COMPATIBILITY_ERROR = 'version compatibility problems'; if (!data.includes(COMPATIBILITY_ERROR)) { @@ -225,9 +228,9 @@ function pushUpdated(basePath, destPath, filePath) { } } const UPDATE_FILE_PUSH_COMMAND = `${util.TOOLS_SDB_PATH} -s ${deviceName} push "${fileFullPath}" "${destPath}${filePath}"`; - exec( + const result = exec( UPDATE_FILE_PUSH_COMMAND, - { silent: util.ISSILENT }, + { encoding: 'utf-8', stdio: 'pipe' }, (code, stdout, stderr) => { if (stderr) { const COMPATIBILITY_ERROR = 'version compatibility problems'; @@ -242,6 +245,8 @@ function pushUpdated(basePath, destPath, filePath) { } } ); + + util.displayOutput(result); } function emitRemoved(basePath, destPath, filePath) { @@ -273,10 +278,12 @@ function pushFsWrapperFile(hostAppPath) { .join(util.WITS_BASE_PATH, WRAPPER_FILE) .replace(regExp.BACKSLASH, '/'); const WRAPPER_FILE_PUSH_COMMAND = `${util.TOOLS_SDB_PATH} -s ${deviceName} push "${WRAPPER_FILE_PATH}" "${hostAppPath}/${WRAPPER_FILE}"`; - exec(WRAPPER_FILE_PUSH_COMMAND, { + const result = exec(WRAPPER_FILE_PUSH_COMMAND, { async: true, - silent: util.ISSILENT + encoding: 'utf-8', + stdio: 'pipe' }); + util.displayOutput(result); } function getWrappedContentFiles(filePath, fileName) { From 43fa3d1f49cb9a53fa531b36eae5486890a92b6c Mon Sep 17 00:00:00 2001 From: Hyojin Kim Date: Tue, 12 Jan 2021 17:19:16 +0900 Subject: [PATCH 3/6] Remove push logs --- lib/watchHelper.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/watchHelper.js b/lib/watchHelper.js index 3687a1c..89ba3dc 100644 --- a/lib/watchHelper.js +++ b/lib/watchHelper.js @@ -167,7 +167,7 @@ function pushFile(baseAppPath, hostAppPath, filesInfo) { encoding: 'utf-8', stdio: 'pipe' }); - util.displayOutput(pushResult); + // util.displayOutput(pushResult); pushResult.stderr.on('data', data => { const COMPATIBILITY_ERROR = 'version compatibility problems'; @@ -246,7 +246,7 @@ function pushUpdated(basePath, destPath, filePath) { } ); - util.displayOutput(result); + // util.displayOutput(result); } function emitRemoved(basePath, destPath, filePath) { @@ -283,7 +283,7 @@ function pushFsWrapperFile(hostAppPath) { encoding: 'utf-8', stdio: 'pipe' }); - util.displayOutput(result); + // util.displayOutput(result); } function getWrappedContentFiles(filePath, fileName) { From b54bf1ed280ce53adce81a731baad322a2a7af2a Mon Sep 17 00:00:00 2001 From: Hyojin Kim Date: Wed, 13 Jan 2021 11:34:23 +0900 Subject: [PATCH 4/6] Add verbose option --- lib/cli.js | 11 +++++++++-- lib/deviceConnectHelper.js | 7 +++---- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/lib/cli.js b/lib/cli.js index cf0a51c..b1964f8 100644 --- a/lib/cli.js +++ b/lib/cli.js @@ -3,6 +3,7 @@ const commander = require('commander'); const program = new commander.Command(); const package = require('../package.json'); +const { logger } = require('./logger'); const util = require('./util.js'); @@ -17,6 +18,7 @@ util.displayBanner(); program.version(`wits v${package.version}`, '-v, --version', 'WITs version'); program.allowUnknownOption(); + program.option('-i, --init', 'Set configuration for running WITs.'); program.option( '-c, --certificate', @@ -50,8 +52,13 @@ if (program.init) { } function checkVerbose(arguments) { - const lastIndex = arguments.length - 1; - if (arguments[lastIndex] === '--verbose') { + const last = arguments.length - 1; + if (arguments.includes('--verbose')) { + if (arguments[last] !== '--verbose') { + logger.log( + `[Warning] Please check the options' order. "--verbose" should be at the end of command.` + ); + } return true; } return false; diff --git a/lib/deviceConnectHelper.js b/lib/deviceConnectHelper.js index 1f70f23..339a603 100644 --- a/lib/deviceConnectHelper.js +++ b/lib/deviceConnectHelper.js @@ -71,12 +71,11 @@ module.exports = { const capability = execSync( `${util.TOOLS_SDB_PATH} -s ${deviceName} capability`, - { stdio: 'pipe' } - ) - .toString() - .split('\n'); + { encoding: 'utf-8', stdio: 'pipe' } + ).split('\n'); capability.forEach(value => { + util.displayOutput(value); if (value.indexOf('sdk_toolpath') !== -1) { appInstallPath = value.replace(regExp.FIND_CR, '').split(':')[1] + '/'; From 679886f77d5e2ca8ff04466e917b65b20bfed6f1 Mon Sep 17 00:00:00 2001 From: Hyojin Kim Date: Wed, 13 Jan 2021 11:36:18 +0900 Subject: [PATCH 5/6] Version up --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index f1af20a..4e1a625 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@tizentv/wits", - "version": "2.4.8", + "version": "2.5.0", "description": "Instant live reload tool for Tizen Web Application development", "main": "index.js", "author": "Samsung Electronics Co., Ltd.", From 35398b86b9420a6309b01b3d7fa5204b8acd0842 Mon Sep 17 00:00:00 2001 From: Hyojin Kim Date: Wed, 13 Jan 2021 11:51:43 +0900 Subject: [PATCH 6/6] Update connect --- command/start.js | 3 +++ command/watch.js | 3 +++ 2 files changed, 6 insertions(+) diff --git a/command/start.js b/command/start.js index 42631b1..965e8c6 100644 --- a/command/start.js +++ b/command/start.js @@ -76,6 +76,9 @@ async function supportDeviceIpOption(data, option) { if (optionDeviceIp) { data.deviceIp = optionDeviceIp; + logger.log( + chalk.cyanBright(`WITs tries connecting with ${optionDeviceIp}\n`) + ); await userInfoHelper.updateLatestUserAnswer({ deviceIp: optionDeviceIp }); diff --git a/command/watch.js b/command/watch.js index 657dd49..141bb6c 100644 --- a/command/watch.js +++ b/command/watch.js @@ -59,6 +59,9 @@ async function supportDeviceIpOption(data, option) { if (optionDeviceIp) { data.deviceIp = optionDeviceIp; + logger.log( + chalk.cyanBright(`WITs tries connecting with ${optionDeviceIp}\n`) + ); await userInfoHelper.updateLatestUserAnswer({ deviceIp: optionDeviceIp });