Skip to content

Commit 8679b9e

Browse files
committed
fix: npm_package issue with external files on windows
1 parent 31aa1a6 commit 8679b9e

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

internal/npm_package/packager.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,8 @@ function main(args) {
9696
}
9797

9898
// src like baseDir/my/path is just copied to outDir/my/path
99-
for (src of srcsArg.split(',').filter(s => !!s)) {
99+
for (let src of srcsArg.split(',').filter(s => !!s)) {
100+
src = src.replace(/\\/g, '/');
100101
if (src.startsWith('external/')) {
101102
// If srcs is from external workspace drop the external/wksp portion
102103
copyWithReplace(
@@ -151,6 +152,7 @@ function main(args) {
151152
for (pkg of packagesArg.split(',').filter(s => !!s)) {
152153
const outDir = outPath(path.dirname(pkg));
153154
function copyRecursive(base, file) {
155+
file = file.replace(/\\/g, '/');
154156
if (fs.lstatSync(path.join(base, file)).isDirectory()) {
155157
const files = fs.readdirSync(path.join(base, file));
156158
files.forEach(f => {

0 commit comments

Comments
 (0)