Skip to content
This repository has been archived by the owner on Aug 11, 2022. It is now read-only.

Commit

Permalink
completion: enable on Windows in git bash
Browse files Browse the repository at this point in the history
npm completion used to be always blocked on Windows, but it works just
fine on Git Bash.

Fixes: #10156
Credit: @jakub-g
Reviewed-By: @othiym23
PR-URL: #10156
  • Loading branch information
jakub-g authored and othiym23 committed Nov 25, 2015
1 parent 4659f1c commit 09498e4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/completion.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ completion.completion = function (opts, cb) {
}

function completion (args, cb) {
if (process.platform === 'win32') {
var e = new Error('npm completion not supported on windows')
if (process.platform === 'win32' && !(/^MINGW(32|64)$/.test(process.env.MSYSTEM))) {
var e = new Error('npm completion supported only in MINGW / Git bash on Windows')
e.code = 'ENOTSUP'
e.errno = require('constants').ENOTSUP
return cb(e)
Expand Down

0 comments on commit 09498e4

Please sign in to comment.