any-rule/scripts/genCommond.js

19 lines
540 B
JavaScript
Raw Normal View History

2019-08-02 14:23:46 +08:00
const RULES = require('../packages/www/src/RULES.js');
const pkg = require('../package.json');
const fs = require('fs');
pkg.contributes.commands = [];
pkg.activationEvents = [];
RULES.forEach((rule, index) => {
pkg.contributes.commands.push({
command: 'extension.rule' + index,
title: `zz: ${rule.title}`
});
pkg.activationEvents.push('onCommand:extension.rule'+index);
})
// console.log(JSON.stringify(pkg));
2019-08-02 23:58:16 +08:00
fs.writeFileSync('./package.json', JSON.stringify(pkg, null, 4), 'utf8');
2019-08-02 14:23:46 +08:00
console.log('完成!');