Skip to content

Commit 32b92b1

Browse files
author
Ajit Kumar
committed
feat(plugin manifest schema);fix(changelog)
1 parent dc3b7ff commit 32b92b1

File tree

6 files changed

+159
-128
lines changed

6 files changed

+159
-128
lines changed

.vscode/pack-zip.js

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,26 @@ const jszip = require('jszip');
55
const iconFile = path.join(__dirname, '../icon.png');
66
const pluginJSON = path.join(__dirname, '../plugin.json');
77
const distFolder = path.join(__dirname, '../dist');
8-
let readmeDotMd = path.join(__dirname, '../readme.md');
9-
let changelogDotMd = path.join(__dirname, '../changelogs.md');
8+
const json = JSON.parse(fs.readFileSync(pluginJSON, 'utf8'));
9+
let readmeDotMd;
10+
let changelogDotMd;
1011

11-
if (!fs.existsSync(readmeDotMd)) {
12-
readmeDotMd = path.join(__dirname, '../README.md');
12+
if (!json.readme) {
13+
readmeDotMd = path.join(__dirname, '../readme.md');
14+
if (!fs.existsSync(readmeDotMd)) {
15+
readmeDotMd = path.join(__dirname, '../README.md');
16+
}
17+
}
18+
19+
20+
if (!json.changelogs) {
21+
if (!fs.existsSync(changelogDotMd)) {
22+
changelogDotMd = path.join(__dirname, '../CHANGELOG.md');
23+
}
24+
25+
if (!fs.existsSync(changelogDotMd)) {
26+
changelogDotMd = path.join(__dirname, '../changelog.md');
27+
}
1328
}
1429

1530
// create zip file of dist folder
@@ -25,9 +40,9 @@ loadFile('', distFolder);
2540

2641
zip
2742
.generateNodeStream({ type: 'nodebuffer', streamFiles: true })
28-
.pipe(fs.createWriteStream(path.join(__dirname, '../dist.zip')))
43+
.pipe(fs.createWriteStream(path.join(__dirname, '../plugin.zip')))
2944
.on('finish', () => {
30-
console.log('Plugin dist.zip written.');
45+
console.log('Plugin plugin.zip written.');
3146
});
3247

3348
function loadFile(root, folder) {
File renamed without changes.

0 commit comments

Comments
 (0)