mirror of
https://github.com/laurent22/joplin.git
synced 2024-12-24 10:27:10 +02:00
21 lines
542 B
JavaScript
21 lines
542 B
JavaScript
|
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);
|
||
|
}
|
||
|
})();
|