Skip to content

Commit

Permalink
Print entries removed from PATH on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
eregon committed Feb 9, 2020
1 parent 71f024b commit e15ecc8
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
10 changes: 9 additions & 1 deletion dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 9 additions & 1 deletion windows.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ async function linkMSYS2() {
}

export function setupPath(msys2, rubyPrefix) {
let path = process.env['PATH'].split(';')
const originalPath = process.env['PATH'].split(';')
let path = originalPath.slice()

// Remove conflicting dev tools from PATH
path = path.filter(e => !e.match(/\b(Chocolatey|CMake|mingw64|OpenSSL|Strawberry)\b/))
Expand All @@ -78,6 +79,13 @@ export function setupPath(msys2, rubyPrefix) {
// Add the downloaded Ruby in PATH
path.unshift(`${rubyPrefix}\\bin`)

console.log("Entries removed from PATH to avoid conflicts with MSYS2 and Ruby:")
for (const entry of originalPath) {
if (!path.includes(entry)) {
console.log(entry)
}
}

const newPath = path.join(';')
core.exportVariable('PATH', newPath)
}

0 comments on commit e15ecc8

Please sign in to comment.