Skip to content

Commit

Permalink
Merge pull request #19589 from joshwooding/fix-addon-paths-on-windows
Browse files Browse the repository at this point in the history
Fix addon URLs on Windows
  • Loading branch information
ndelangen authored Oct 24, 2022
2 parents 2b504f9 + 3fbbcca commit e4e46c1
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions code/lib/builder-manager/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
"express": "^4.17.1",
"fs-extra": "^9.0.1",
"process": "^0.11.10",
"slash": "^3.0.0",
"util": "^0.12.4"
},
"devDependencies": {
Expand Down
3 changes: 2 additions & 1 deletion code/lib/builder-manager/src/utils/files.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { OutputFile } from 'esbuild';
import fs from 'fs-extra';
import { join } from 'path';
import slash from 'slash';
import { Compilation } from '../types';

export async function readOrderedFiles(
Expand All @@ -26,6 +27,6 @@ export async function readOrderedFiles(
export function sanitizePath(file: OutputFile, addonsDir: string) {
const filePath = file.path.replace(addonsDir, '');
const location = join(addonsDir, filePath);
const url = `./sb-addons${filePath.split('/').map(encodeURIComponent).join('/')}`;
const url = `./sb-addons${slash(filePath).split('/').map(encodeURIComponent).join('/')}`;
return { location, url };
}
1 change: 1 addition & 0 deletions code/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7061,6 +7061,7 @@ __metadata:
express: ^4.17.1
fs-extra: ^9.0.1
process: ^0.11.10
slash: ^3.0.0
typescript: ~4.6.3
util: ^0.12.4
languageName: unknown
Expand Down

0 comments on commit e4e46c1

Please sign in to comment.