Skip to content
This repository was archived by the owner on Oct 1, 2024. It is now read-only.

Commit 6576031

Browse files
codeworm96yaohaizh
authored andcommitted
Add browse.path when include library (#380)
1 parent f6e5343 commit 6576031

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/arduino/arduino.ts

+14
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,20 @@ export class ArduinoApp {
232232
configSection.includePath.push(childLibPath);
233233
});
234234

235+
libPaths.forEach((childLibPath) => {
236+
childLibPath = path.resolve(path.normalize(childLibPath));
237+
if (configSection.browse.path && configSection.browse.path.length) {
238+
for (const existingPath of configSection.browse.path) {
239+
if (childLibPath === path.resolve(path.normalize(existingPath))) {
240+
return;
241+
}
242+
}
243+
} else {
244+
configSection.browse.path = [];
245+
}
246+
configSection.browse.path.push(childLibPath);
247+
});
248+
235249
fs.writeFileSync(configFilePath, JSON.stringify(deviceContext, null, 4));
236250
}
237251

0 commit comments

Comments
 (0)