Prefer path.delimiter to the hardcoded value

This commit is contained in:
Benoit Daloze
2020-03-30 22:04:39 +02:00
parent 2641afc25c
commit 9c77d1b41f
2 changed files with 4 additions and 2 deletions
Generated Vendored
+2 -1
View File
@@ -4801,6 +4801,7 @@ __webpack_require__.r(__webpack_exports__);
// https://github.com/MSP-Greg/actions-ruby/blob/master/lib/main.js // https://github.com/MSP-Greg/actions-ruby/blob/master/lib/main.js
const fs = __webpack_require__(747) const fs = __webpack_require__(747)
const path = __webpack_require__(622)
const cp = __webpack_require__(129) const cp = __webpack_require__(129)
const core = __webpack_require__(470) const core = __webpack_require__(470)
const exec = __webpack_require__(986) const exec = __webpack_require__(986)
@@ -4940,7 +4941,7 @@ function addVCVARSEnv() {
for (let [k, v] of newEnv) { for (let [k, v] of newEnv) {
if (process.env[k] !== v) { if (process.env[k] !== v) {
if (k === 'Path') { if (k === 'Path') {
newPathEntries = v.replace(process.env['Path'], '').split(';') newPathEntries = v.replace(process.env['Path'], '').split(path.delimiter)
} else { } else {
core.exportVariable(k, v) core.exportVariable(k, v)
} }
+2 -1
View File
@@ -2,6 +2,7 @@
// https://github.com/MSP-Greg/actions-ruby/blob/master/lib/main.js // https://github.com/MSP-Greg/actions-ruby/blob/master/lib/main.js
const fs = require('fs') const fs = require('fs')
const path = require('path')
const cp = require('child_process') const cp = require('child_process')
const core = require('@actions/core') const core = require('@actions/core')
const exec = require('@actions/exec') const exec = require('@actions/exec')
@@ -141,7 +142,7 @@ export function addVCVARSEnv() {
for (let [k, v] of newEnv) { for (let [k, v] of newEnv) {
if (process.env[k] !== v) { if (process.env[k] !== v) {
if (k === 'Path') { if (k === 'Path') {
newPathEntries = v.replace(process.env['Path'], '').split(';') newPathEntries = v.replace(process.env['Path'], '').split(path.delimiter)
} else { } else {
core.exportVariable(k, v) core.exportVariable(k, v)
} }