Skip to content

Commit 87f0ce3

Browse files
committed
Modify vsce npm-module's package command to strip the leading '.'
from the file extension string that is populated in [Content-Types.xml] for the different files in the extension. Signed-off-by: Siddharth Srinivasan <[email protected]>
1 parent 0d9fa3b commit 87f0ce3

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

build.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,14 @@
255255
<arg value="@vscode/[email protected]" />
256256
</exec>
257257

258+
<exec executable="patch" dir="${build.dir}/vsce/node_modules/@vscode/vsce/out" failifexecutionfails="false" failonerror="false">
259+
<arg value="-p1"/>
260+
<arg value="-z"/>
261+
<arg value=".orig"/>
262+
<arg value="-i"/>
263+
<arg value="${basedir}/patches/vsce-package-ContentTypes.diff"/>
264+
</exec>
265+
258266
<move todir="${basedir}/vscode/node_modules" includeemptydirs="false">
259267
<fileset dir="${basedir}/vscode/node_modules">
260268
<include name="**/LICENSE"/>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
diff --git a/package.js.orig b/package.js
2+
index 5bc5e0c..4aa4b79 100644
3+
--- a/package.js.orig
4+
+++ b/package.js
5+
@@ -1088,7 +1088,8 @@ async function toContentTypes(files) {
6+
}
7+
const contentTypes = [];
8+
for (const [extension, contentType] of mimetypes) {
9+
- contentTypes.push(`<Default Extension="${extension}" ContentType="${contentType}"/>`);
10+
+ const extn = (extension.startsWith('.') && extension.length > 1) ? extension.substring(1) : extension;
11+
+ contentTypes.push(`<Default Extension="${extn}" ContentType="${contentType}"/>`);
12+
}
13+
return `<?xml version="1.0" encoding="utf-8"?>
14+
<Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types">${contentTypes.join('')}</Types>

0 commit comments

Comments
 (0)