quickstart-nodejs
quickstart-nodejs copied to clipboard
config/index.js does not exit after executing
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();
});
}
@autumnw that's quite strange, we should not need to use process.exit()
to get it to exit, but I am not opposed to adding that.
Also the Firebase CLI recently added remoteconfig
commands which may be a better option for you.
cc @kroikie