Read the statement by Michael Teeuw here.
Volvo on Call
-
list: function() { exec("voc list", (e, sdo, sde)=>{ if (e) { console.log("[VOC] ERROR(>list):", e.toString()) } else { this.listResult(sdo) } }) },
then the good results are parsed in listResult()
-
@sdetweil Thank you Sam! Can you please tell me what the letters in the bracket mean?
(e, sdo, sde)
-
@mz-ber Oh I guess I understand. If the function is not getting the right details than ->
e
if everything is okay than ->sdo
-
@mz-ber exec(“voc list”, (e, sdo, sde)=
execs the command “voc list”
and the exec function returns
error (e)
stdout (sdo)
and stderr(sde)so if no error (e is null)
it sends the command output to the listResults function
-
@sdetweil Thank you for the explanation. Is the function executing
voc list
in the terminal? If I’m doing manuallyvoc list
I’m getting a result.Is there a way to see what the script is getting back in detail?
Again, thank you very much!
-
@mz-ber yes executing just like on console
nothing built in to show results.
but you could add a
console.log(sdo)
before the call to listResults()
and see it where u start mm
npm startit should be the same outout
-
@sdetweil Alright, I added the console.log before the call
listResult()
and it is getting the details from my car. I feel sooo close to get this running but I dont know where it is stuck. :anguished_face:Is maybe the regex search not getting the details viewed?
listResult: function(output) { var re = /^([^ ]+)\s\(([^\)]+)\)\s([^ ]+)$/gm
-
@mz-ber so the regular expression isn’t finding your text
/^([^ ]+)\s\(([^\)]+)\)\s([^ ]+)$/gm
I use this for building and testing rejects
-
@sdetweil Yes, I also checked that with regex101. Can I just parse in the details I have?
listResult: function(output) { var re = B-PY 186 (V90) XVASS123345
-
@mz-ber the regex returns an array of matched things