mirror of
https://github.com/any86/any-rule.git
synced 2025-07-14 15:38:58 +08:00
21 lines
543 B
JavaScript
21 lines
543 B
JavaScript
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));
|
|
fs.writeFileSync('./package.json', JSON.stringify(pkg, null, 4), 'utf-8');
|
|
console.log('完成!'); |