From 7d84630f8d3acfb5f024bd96fa362f8c3fab3927 Mon Sep 17 00:00:00 2001 From: BeniBenj Date: Sun, 6 Oct 2024 22:13:48 +0200 Subject: [PATCH 1/2] fix #1048 --- src/package.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/package.ts b/src/package.ts index d960f155..f31e9689 100644 --- a/src/package.ts +++ b/src/package.ts @@ -767,6 +767,11 @@ export abstract class MarkdownProcessor extends BaseProcessor { if (!this.regexp.test(filePath)) { return Promise.resolve(file); } + + return await this.processFile(file, filePath); + } + + protected async processFile(file: IFile, filePath: string): Promise { this.filesProcessed++; this.assets.push({ type: this.assetType, path: filePath }); @@ -970,6 +975,11 @@ export class ReadmeProcessor extends MarkdownProcessor { ); } + override async processFile(file: IFile): Promise { + file.path = 'extension/readme.md'; + return await super.processFile(file, file.path); + } + override async onEnd(): Promise { if (this.options.readmePath && this.filesProcessed === 0) { util.log.error(`The provided readme file (${this.options.readmePath}) could not be found.`); @@ -989,6 +999,11 @@ export class ChangelogProcessor extends MarkdownProcessor { ); } + override async processFile(file: IFile): Promise { + file.path = 'extension/changelog.md'; + return await super.processFile(file, file.path); + } + override async onEnd(): Promise { if (this.options.changelogPath && this.filesProcessed === 0) { util.log.error(`The provided changelog file (${this.options.changelogPath}) could not be found.`); From b7830c3eeef239b72a9924331d8381c0bd9530dd Mon Sep 17 00:00:00 2001 From: BeniBenj Date: Sun, 6 Oct 2024 22:23:19 +0200 Subject: [PATCH 2/2] adapt tests --- src/test/package.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/test/package.test.ts b/src/test/package.test.ts index f1cf1962..ba18dac3 100644 --- a/src/test/package.test.ts +++ b/src/test/package.test.ts @@ -706,7 +706,7 @@ describe('toVsixManifest', () => { result.PackageManifest.Assets[0].Asset[1].$.Type, 'Microsoft.VisualStudio.Services.Content.Details' ); - assert.strictEqual(result.PackageManifest.Assets[0].Asset[1].$.Path, 'extension/foo/readme-foo.md'); + assert.strictEqual(result.PackageManifest.Assets[0].Asset[1].$.Path, 'extension/readme.md'); }); }); @@ -752,7 +752,7 @@ describe('toVsixManifest', () => { result.PackageManifest.Assets[0].Asset[1].$.Type, 'Microsoft.VisualStudio.Services.Content.Changelog' ); - assert.strictEqual(result.PackageManifest.Assets[0].Asset[1].$.Path, 'extension/foo/changelog-foo.md'); + assert.strictEqual(result.PackageManifest.Assets[0].Asset[1].$.Path, 'extension/changelog.md'); }); });