Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

config/index.js does not exit after executing #183

Open
autumnw opened this issue Dec 12, 2020 · 2 comments
Open

config/index.js does not exit after executing #183

autumnw opened this issue Dec 12, 2020 · 2 comments

Comments

@autumnw
Copy link

autumnw commented Dec 12, 2020

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();
      });
}
@samtstern
Copy link
Contributor

@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
Copy link
Contributor

cc @kroikie

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants