1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-21 09:38:01 +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);
}
})();