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.`); 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'); }); });