Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
run-script: Do not use SET to fetch the env in git-bash or cygwin
Credit: @gucong3000
PR-URL: #19418
Reviewed-By: @iarna
  • Loading branch information
gucong3000 authored and iarna committed Jul 10, 2018
1 parent 7984206 commit 4c32413a5b42e18a34afb078cf00eed60f08e4ff
Showing with 4 additions and 2 deletions.
  1. +2 −1 lib/run-script.js
  2. +2 −1 lib/utils/is-windows-bash.js
@@ -9,6 +9,7 @@ var chain = require('slide').chain
var usage = require('./utils/usage')
var output = require('./utils/output.js')
var didYouMean = require('./utils/did-you-mean')
var isWindowsShell = require('./utils/is-windows-shell.js')

runScript.usage = usage(
'run-script',
@@ -139,7 +140,7 @@ function run (pkg, wd, cmd, args, cb) {
if (cmd === 'test') {
pkg.scripts.test = 'echo \'Error: no test specified\''
} else if (cmd === 'env') {
if (process.platform === 'win32') {
if (isWindowsShell) {
log.verbose('run-script using default platform env: SET (Windows)')
pkg.scripts[cmd] = 'SET'
} else {
@@ -1,3 +1,4 @@
'use strict'
var isWindows = require('./is-windows.js')
module.exports = isWindows && /^MINGW(32|64)$/.test(process.env.MSYSTEM)
module.exports = isWindows &&
(/^MINGW(32|64)$/.test(process.env.MSYSTEM) || process.env.TERM === "cygwin")

0 comments on commit 4c32413

Please sign in to comment.