Skip to content

Commit 4cc3e45

Browse files
committedApr 9, 2021
Fix PATH modification logical bug
1 parent b944f65 commit 4cc3e45

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed
 

‎src/api/src/library/Platformio/index.ts

+3
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ interface PlatformioCoreState {
2121
}
2222

2323
const prependPATH = (pth: string, item: string): string => {
24+
if (pth.indexOf(item) > -1) {
25+
return pth;
26+
}
2427
if (pth.length > 0) {
2528
return `${item}${path.delimiter}${pth}`;
2629
}

‎src/main.dev.ts

+3
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,9 @@ const createWindow = async () => {
189189
*/
190190
let PATH = process.env.PATH ?? '';
191191
const prependPATH = (pth: string, item: string): string => {
192+
if (pth.indexOf(item) > -1) {
193+
return pth;
194+
}
192195
if (pth.length > 0) {
193196
return `${item}${path.delimiter}${pth}`;
194197
}

0 commit comments

Comments
 (0)
Please sign in to comment.