quickstart-nodejs icon indicating copy to clipboard operation
quickstart-nodejs copied to clipboard

config/index.js does not exit after executing

Open autumnw opened this issue 4 years ago • 2 comments

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 avatar Dec 12 '20 18:12 autumnw

@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.

samtstern avatar Dec 14 '20 11:12 samtstern

cc @kroikie

samtstern avatar Dec 14 '20 11:12 samtstern