From 789d766a49a3af5b0005c3631ed1ac0a572e4c39 Mon Sep 17 00:00:00 2001 From: gavin1012_hw Date: Sat, 8 Oct 2022 15:29:42 +0800 Subject: [PATCH] Fix watch-expression failure caused by blank-space in sdk path Issue: I5UGDM Signed-off-by: gavin1012_hw Change-Id: Iaba01b295af78fdfc637c46e82088df4129fa8e5 --- ts2panda/src/index.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/ts2panda/src/index.ts b/ts2panda/src/index.ts index e243c78b0d..bc87b8b9ce 100644 --- a/ts2panda/src/index.ts +++ b/ts2panda/src/index.ts @@ -209,9 +209,9 @@ const es2abcBase64Input = "--base64Input"; const es2abcDebuggerEvaluateFlag = "--debugger-evaluate-expression"; const es2abcBase64Output = "--base64Output"; -function callEs2pandaToolChain(ideIputStr: string) { - let commandLine = es2abcBinaryPath + es2abcBinaryName + " " + es2abcBase64Input + " \"" + ideIputStr + "\" " + - es2abcDebuggerEvaluateFlag + " " + es2abcBase64Output; +function callEs2pandaToolChain(ideInputStr: string) { + let commandLine = "\"" + es2abcBinaryPath + es2abcBinaryName + "\" " + es2abcBase64Input + " \"" + ideInputStr + + "\" " + es2abcDebuggerEvaluateFlag + " " + es2abcBase64Output; var exec = require('child_process').exec; exec(`${commandLine}`, function(error, stdout) { if (error) { @@ -223,18 +223,18 @@ function callEs2pandaToolChain(ideIputStr: string) { } function updateWatchJsFile() { - let ideIputStr = CmdOptions.getEvaluateExpression(); + let ideInputStr = CmdOptions.getEvaluateExpression(); if (CmdOptions.watchViaEs2pandaToolchain()) { - callEs2pandaToolChain(ideIputStr); + callEs2pandaToolChain(ideInputStr); return; } - if (!isBase64Str(ideIputStr)) { + if (!isBase64Str(ideInputStr)) { throw new Error("Passed expression string for evaluating is not base64 style."); } let watchAbcFileTimeOut = watchAbcFileDefaultTimeOut; if (CmdOptions.getWatchTimeOutValue() != 0) { watchAbcFileTimeOut = CmdOptions.getWatchTimeOutValue(); } let watchFilePrefix = CmdOptions.getWatchJsPath() + path.sep + watchFileName; - let originExpre = Buffer.from(ideIputStr, 'base64').toString(); + let originExpre = Buffer.from(ideInputStr, 'base64').toString(); let jsFileName = watchFilePrefix + ".js"; let abcFileName = watchFilePrefix + ".abc"; let errorMsgFileName = watchFilePrefix + ".err"; -- Gitee