Skip to content

Commit 882f9c6

Browse files
author
Akos Kitta
committed
fix: use text --format for the CLI
`Can't write debug log: available only in text format` error is thrown by the CLI if the `--debug` flag is present. Ref: arduino/arduino-cli#2003 Closes #1942 Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
1 parent 24dc0bb commit 882f9c6

File tree

2 files changed

+24
-23
lines changed

2 files changed

+24
-23
lines changed

arduino-ide-extension/package.json

+5-1
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,11 @@
163163
],
164164
"arduino": {
165165
"cli": {
166-
"version": "0.31.0"
166+
"version": {
167+
"owner": "arduino",
168+
"repo": "arduino-cli",
169+
"commitish": "6992de7"
170+
}
167171
},
168172
"fwuploader": {
169173
"version": "2.2.2"

arduino-ide-extension/src/node/arduino-daemon-impl.ts

+19-22
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,6 @@ export class ArduinoDaemonImpl
134134
const cliConfigPath = join(FileUri.fsPath(configDirUri), CLI_CONFIG);
135135
const args = [
136136
'daemon',
137-
'--format',
138-
'jsonmini',
139137
'--port',
140138
'0',
141139
'--config-file',
@@ -197,26 +195,6 @@ export class ArduinoDaemonImpl
197195

198196
daemon.stdout.on('data', (data) => {
199197
const message = data.toString();
200-
201-
let port = '';
202-
let address = '';
203-
message
204-
.split('\n')
205-
.filter((line: string) => line.length)
206-
.forEach((line: string) => {
207-
try {
208-
const parsedLine = JSON.parse(line);
209-
if ('Port' in parsedLine) {
210-
port = parsedLine.Port;
211-
}
212-
if ('IP' in parsedLine) {
213-
address = parsedLine.IP;
214-
}
215-
} catch (err) {
216-
// ignore
217-
}
218-
});
219-
220198
this.onData(message);
221199
if (!grpcServerIsReady) {
222200
const error = DaemonError.parse(message);
@@ -225,6 +203,25 @@ export class ArduinoDaemonImpl
225203
return;
226204
}
227205

206+
let port = '';
207+
let address = '';
208+
message
209+
.split('\n')
210+
.filter((line: string) => line.length)
211+
.forEach((line: string) => {
212+
try {
213+
const parsedLine = JSON.parse(line);
214+
if ('Port' in parsedLine) {
215+
port = parsedLine.Port;
216+
}
217+
if ('IP' in parsedLine) {
218+
address = parsedLine.IP;
219+
}
220+
} catch (err) {
221+
// ignore
222+
}
223+
});
224+
228225
if (port.length && address.length) {
229226
grpcServerIsReady = true;
230227
ready.resolve({ daemon, port });

0 commit comments

Comments
 (0)