Skip to content

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

Merged
bcomnes merged 1 commit into
ungoldman:masterfrom
whalemare:hotfix/dynamic-read
Sep 20, 2021
Merged

Replace static "require" to dynamic "read"#137
bcomnes merged 1 commit into
ungoldman:masterfrom
whalemare:hotfix/dynamic-read

Conversation

@whalemare

Copy link
Copy Markdown
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

@bcomnes bcomnes left a comment

Copy link
Copy Markdown
Collaborator

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
Copy Markdown
Owner

seems ok to me 👍

@whalemare

Copy link
Copy Markdown
Contributor Author

Have we a chance to merge it?

@bcomnes

bcomnes commented Sep 20, 2021

Copy link
Copy Markdown
Collaborator

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