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

Replace static "require" to dynamic "read" #137

Merged
merged 1 commit into from
Sep 20, 2021

Conversation

whalemare
Copy link
Contributor

This allow to read dynamically changes package.json file.

For example, in runtime when we run script that update package.json version and create release on github.

  • In case, when we use require, it will holds content of package.json and not change it while script not started again. So, we can't read actual version from it, because it changed in runtime

  • In case, when we use read, we always read fresh state of package.json with latest actual changes

This allow to read dynamically changes package.json file.
For example, in runtime when we run script that update package.json version and create release on github.
* In case, when we use `require`, it will holds content of package.json and not change it while script not started again. So, we can't read actual version from it, because it changed in runtime
* In case, when we use `read`, we always read fresh state of package.json with latest actual changes
Copy link
Collaborator

@bcomnes bcomnes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fine with me, thoughts @ungoldman

@ungoldman
Copy link
Owner

seems ok to me 👍

@whalemare
Copy link
Contributor Author

Have we a chance to merge it?

@bcomnes
Copy link
Collaborator

bcomnes commented Sep 20, 2021

Sorry, fell through the cracks. Will get it out today.

@bcomnes bcomnes merged commit 6920478 into ungoldman:master Sep 20, 2021
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

Successfully merging this pull request may close these issues.

3 participants