Skip to content

Commit a154e8c

Browse files
authored
Merge pull request #392 from tzfrs/master
Improve error message when packaging an extension with an unchanged README.md
2 parents 2265546 + 4903798 commit a154e8c

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

src/package.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ export class MarkdownProcessor extends BaseProcessor {
328328
let contents = await read(file);
329329

330330
if (/This is the README for your extension /.test(contents)) {
331-
throw new Error(`Make sure to edit the README.md file before you publish your extension.`);
331+
throw new Error(`Make sure to edit the README.md file before you package or publish your extension.`);
332332
}
333333

334334
const markdownPathRegex = /(!?)\[([^\]\[]*|!\[[^\]\[]*]\([^\)]+\))\]\(([^\)]+)\)/g;

src/test/package.test.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1594,4 +1594,13 @@ describe('MarkdownProcessor', () => {
15941594

15951595
await throws(() => processor.onFile(readme));
15961596
});
1597+
1598+
it('should catch an unchanged README.md', async () => {
1599+
const manifest = { name: 'test', publisher: 'mocha', version: '0.0.1', engines: Object.create(null), repository: 'https://github.com/username/repository' };
1600+
const contents = `This is the README for your extension `;
1601+
const processor = new ReadmeProcessor(manifest, {});
1602+
const readme = { path: 'extension/readme.md', contents };
1603+
1604+
await throws(() => processor.onFile(readme));
1605+
})
15971606
});

0 commit comments

Comments
 (0)