config/index.js does not exit after executing
autumnw opened this issue · 2 comments
autumnw commented
When I run "node config/index.js get", it was actually executed successfully, but it does not exit.
Shall we need to add "finally" block like the following?
function getTemplate() {
const config = admin.remoteConfig();
config.getTemplate()
.then(template => {
console.log('ETag from server: ' + template.etag);
const templateStr = JSON.stringify(template, null, 2);
fs.writeFileSync('config.json', templateStr);
})
.catch(err => {
console.error('Unable to get template');
console.error(err);
}).finally(() => {
process.exit();
});
}