1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-27 10:32:58 +02:00
joplin/Assets/TinyMCE/IconPack/postinstall.js

21 lines
542 B
JavaScript
Raw Normal View History

const prompts = require('prompts');
const fs = require('fs');
(async function() {
const response = await prompts({
type: 'text',
name: 'iconPackName',
message: 'Enter the name of the icon pack.',
validate: function(iconPackName) { return iconPackName.length > 0; },
});
try {
const contents = fs.readFileSync('package.json');
obj = JSON.parse(contents);
obj.iconPackName = response.iconPackName;
fs.writeFileSync('package.json', JSON.stringify(obj, undefined, 2));
} catch (err) {
console.error(err.message);
}
})();