@@ -68,18 +68,23 @@ jobs:
68
68
if : matrix.mingwdir != ''
69
69
run : |
70
70
import os
71
-
72
71
paths = [
73
72
r'C:\msys64\${{ matrix.mingwdir }}\bin',
74
73
r'C:\msys64\usr\bin',
75
74
]
76
- with open(os.environ["GITHUB_PATH"], "a") as f:
77
- for path in paths:
78
- f.write(path + "\n")
75
+ excluded = {
76
+ r'C:\mingw64\bin',
77
+ }
78
+ with open(os.environ["GITHUB_PATH"], "r+") as fp:
79
+ lines = fp.readlines()
80
+ lines = paths + [l for l in lines if l not in excluded]
81
+ fp.seek(0)
82
+ fp.writelines(lines)
79
83
- name : Verify mingw gcc installation
80
84
shell : powershell
81
85
if : matrix.mingwdir != ''
82
86
run : |
87
+ choco uninstall -y strawberryperl
83
88
Get-Command ${{ matrix.gcc }}
84
89
- name : Set PATH
85
90
run : |
@@ -223,18 +228,23 @@ jobs:
223
228
if : matrix.mingwdir != ''
224
229
run : |
225
230
import os
226
-
227
231
paths = [
228
232
r'C:\msys64\${{ matrix.mingwdir }}\bin',
229
233
r'C:\msys64\usr\bin',
230
234
]
231
- with open(os.environ["GITHUB_PATH"], "a") as f:
232
- for path in paths:
233
- f.write(path + "\n")
235
+ excluded = {
236
+ r'C:\mingw64\bin',
237
+ }
238
+ with open(os.environ["GITHUB_PATH"], "r+") as fp:
239
+ lines = fp.readlines()
240
+ lines = paths + [l for l in lines if l not in excluded]
241
+ fp.seek(0)
242
+ fp.writelines(lines)
234
243
- name : Verify mingw gcc installation
235
244
shell : powershell
236
245
if : matrix.mingwdir != ''
237
246
run : |
247
+ choco uninstall -y strawberryperl
238
248
Get-Command ${{ matrix.gcc }}
239
249
- name : Set PATH
240
250
run : |
@@ -384,18 +394,23 @@ jobs:
384
394
if : matrix.mingwdir != ''
385
395
run : |
386
396
import os
387
-
388
397
paths = [
389
398
r'C:\msys64\${{ matrix.mingwdir }}\bin',
390
399
r'C:\msys64\usr\bin',
391
400
]
392
- with open(os.environ["GITHUB_PATH"], "a") as f:
393
- for path in paths:
394
- f.write(path + "\n")
401
+ excluded = {
402
+ r'C:\mingw64\bin',
403
+ }
404
+ with open(os.environ["GITHUB_PATH"], "r+") as fp:
405
+ lines = fp.readlines()
406
+ lines = paths + [l for l in lines if l not in excluded]
407
+ fp.seek(0)
408
+ fp.writelines(lines)
395
409
- name : Verify mingw gcc installation
396
410
shell : powershell
397
411
if : matrix.mingwdir != ''
398
412
run : |
413
+ choco uninstall -y strawberryperl
399
414
Get-Command ${{ matrix.gcc }}
400
415
- name : Set PATH
401
416
run : |
0 commit comments