Make sure changelog has his own assetType

This commit is contained in:
XVincentX 2016-09-22 15:16:38 +02:00
parent a3f8c04127
commit fbd39b8265
No known key found for this signature in database
GPG key ID: D618C95BD28F3AE0
2 changed files with 5 additions and 5 deletions

View file

@ -251,7 +251,7 @@ export class MarkdownProcessor extends BaseProcessor {
private baseContentUrl: string;
private baseImagesUrl: string;
constructor(manifest: Manifest, private regexp : RegExp, options: IPackageOptions= {}) {
constructor(manifest: Manifest, private regexp : RegExp, private assetType: string, options: IPackageOptions= {}) {
super(manifest);
const guess = this.guessBaseUrls();
@ -267,7 +267,7 @@ export class MarkdownProcessor extends BaseProcessor {
return Promise.resolve(file);
}
this.assets.push({ type: 'Microsoft.VisualStudio.Services.Content.Details', path });
this.assets.push({ type: this.assetType, path });
return read(file)
.then(contents => {
@ -334,13 +334,13 @@ export class MarkdownProcessor extends BaseProcessor {
export class ReadmeProcessor extends MarkdownProcessor {
constructor(manifest: Manifest, options: IPackageOptions= {}) {
super(manifest, /^extension\/readme.md$/i, options);
super(manifest, /^extension\/readme.md$/i, 'Microsoft.VisualStudio.Services.Content.Details', options);
}
}
export class ChangelogProcessor extends MarkdownProcessor {
constructor(manifest: Manifest, options: IPackageOptions= {}) {
super(manifest, /^extension\/changelog.md$/i, options);
super(manifest, /^extension\/changelog.md$/i, 'Microsoft.VisualStudio.Services.Content.Changelog', options);
}
}

View file

@ -234,7 +234,7 @@ describe('toVsixManifest', () => {
.then(xml => parseXmlManifest(xml))
.then(result => {
assert.equal(result.PackageManifest.Assets[0].Asset.length, 2);
assert.equal(result.PackageManifest.Assets[0].Asset[1].$.Type, 'Microsoft.VisualStudio.Services.Content.Details');
assert.equal(result.PackageManifest.Assets[0].Asset[1].$.Type, 'Microsoft.VisualStudio.Services.Content.Changelog');
assert.equal(result.PackageManifest.Assets[0].Asset[1].$.Path, 'extension/changelog.md');
});
});