GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — win: make VS path match case-insensitive · nodejs/node-gyp@656117c

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • lib
    • find-visualstudio.js
  • test
    • test-find-visualstudio.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎lib/find-visualstudio.js‎

Copy file name to clipboardExpand all lines: lib/find-visualstudio.js
+4-2Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -405,11 +405,13 @@ VisualStudioFinder.prototype = {
405405
this.addLog('- msvs_version does not match this version')
406406
return false
407407
}
408-
if (this.configPath && this.configPath !== vsPath) {
408+
if (this.configPath &&
409+
path.relative(this.configPath, vsPath) !== '') {
409410
this.addLog('- msvs_version does not point to this installation')
410411
return false
411412
}
412-
if (this.envVcInstallDir && this.envVcInstallDir !== vsPath) {
413+
if (this.envVcInstallDir &&
414+
path.relative(this.envVcInstallDir, vsPath) !== '') {
413415
this.addLog('- does not match this Visual Studio Command Prompt')
414416
return false
415417
}
Collapse file

‎test/test-find-visualstudio.js‎

Copy file name to clipboardExpand all lines: test/test-find-visualstudio.js
+32-1Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -525,7 +525,7 @@ test('look for VS2019 by version number', function (t) {
525525
finder.findVisualStudio()
526526
})
527527

528-
test('look for VS2017 by installation path', function (t) {
528+
test('look for VS2019 by installation path', function (t) {
529529
t.plan(2)
530530

531531
const finder = new TestVisualStudioFinder(semverV1,
@@ -540,6 +540,21 @@ test('look for VS2017 by installation path', function (t) {
540540
finder.findVisualStudio()
541541
})
542542

543+
test('msvs_version match should be case insensitive', function (t) {
544+
t.plan(2)
545+
546+
const finder = new TestVisualStudioFinder(semverV1,
547+
'c:\\program files (x86)\\microsoft visual studio\\2019\\BUILDTOOLS',
548+
(err, info) => {
549+
t.strictEqual(err, null)
550+
t.deepEqual(info.path,
551+
'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools')
552+
})
553+
554+
allVsVersions(t, finder)
555+
finder.findVisualStudio()
556+
})
557+
543558
test('latest version should be found by default', function (t) {
544559
t.plan(2)
545560

@@ -568,6 +583,22 @@ test('run on a usable VS Command Prompt', function (t) {
568583
finder.findVisualStudio()
569584
})
570585

586+
test('VCINSTALLDIR match should be case insensitive', function (t) {
587+
t.plan(2)
588+
589+
process.env.VCINSTALLDIR =
590+
'c:\\program files (x86)\\microsoft visual studio\\2019\\BUILDTOOLS\\VC'
591+
592+
const finder = new TestVisualStudioFinder(semverV1, null, (err, info) => {
593+
t.strictEqual(err, null)
594+
t.deepEqual(info.path,
595+
'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools')
596+
})
597+
598+
allVsVersions(t, finder)
599+
finder.findVisualStudio()
600+
})
601+
571602
test('run on a unusable VS Command Prompt', function (t) {
572603
t.plan(2)
573604

0 commit comments

Comments
0 (0)
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.