Sfoglia il codice sorgente

Merge pull request #721 from dhirschfeld/fix-windows-build

Fix incorrect use of backslashes in path on windows
Steven Silvester 8 anni fa
parent
commit
76dc37b849
1 ha cambiato i file con 3 aggiunte e 3 eliminazioni
  1. 3 3
      scripts/extension_helpers.js

+ 3 - 3
scripts/extension_helpers.js

@@ -104,7 +104,7 @@ function createShim(modName, sourceFolder) {
   // Find the path to the module.
   var modPath = require.resolve(modName + '/package.json');
   sourceFolder = sourceFolder || 'lib';
-  modPath = path.join(path.dirname(modPath), sourceFolder);
+  modPath = path.posix.join(path.dirname(modPath), sourceFolder);
 
   // Walk through the source tree.
   var entries = walkSync.entries(modPath, {
@@ -113,9 +113,9 @@ function createShim(modName, sourceFolder) {
   });
   for (var i = 0; i < entries.length; i++) {
     // Get the relative path to the entry.
-    var entryPath = path.join(sourceFolder, entries[i].relativePath);
+    var entryPath = path.posix.join(sourceFolder, entries[i].relativePath);
     // Add an entries for each file.
-    lines.push('shim["' + entryPath + '"] = require("' + path.join(modName, entryPath) + '");');
+    lines.push('shim["' + entryPath + '"] = require("' + path.posix.join(modName, entryPath) + '");');
   }
   lines.push('module.exports = shim;');