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

Add missing node os.release() implementation #4065

Merged
merged 5 commits into from
Feb 24, 2020

Conversation

ecyrbe
Copy link
Contributor

@ecyrbe ecyrbe commented Feb 21, 2020

PR for one of the tasks from issue #3802 . Adding platform support as it's now there on process impl .

ps: planning to make more of thoses as i learn deno a little more before starting more serious contributions.

@ecyrbe ecyrbe force-pushed the feature/add-os-release branch 3 times, most recently from efce9fd to efc9454 Compare February 21, 2020 18:12
@ecyrbe

This comment has been minimized.

cli/ops/os.rs Outdated
_zero_copy: Option<ZeroCopyBuf>,
) -> Result<JsonOp, ErrBox> {
state.check_env()?;
let release = sys_info::os_release().unwrap_or_else(|_| "".to_owned());
Copy link
Contributor

@bnoordhuis bnoordhuis Feb 21, 2020

Choose a reason for hiding this comment

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

With Node.js, os.release() on Windows returns "<major>.<minor>.<build>" whereas sys_info::os_release() returns just "<major>.<minor>".

I could PR a change to sys_info adding the build number but we seem to have pinned it to an older version because of Windows breakage in the latest version...

edit: I went ahead and did it anyway: FillZpp/sys-info-rs#47

Copy link
Contributor Author

Choose a reason for hiding this comment

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

nice, thank you.

@ecyrbe ecyrbe force-pushed the feature/add-os-release branch 2 times, most recently from 55c9d73 to 4d6ce6a Compare February 23, 2020 00:01
@ecyrbe
Copy link
Contributor Author

ecyrbe commented Feb 23, 2020

i rebased to fix merge conflicts.

@ecyrbe
Copy link
Contributor Author

ecyrbe commented Feb 23, 2020

using to_string instead of to_owned (is there a rule of thumb in deno for witch the team prefer to use ?)
hence the two are now the same since : rust-lang/rust#32586, but i think to_string is clearer (some think the opposite)

Copy link
Member

@ry ry left a comment

Choose a reason for hiding this comment

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

LGTM

@ry ry merged commit fb08cf7 into denoland:master Feb 24, 2020
caspervonb pushed a commit to caspervonb/deno_std that referenced this pull request Jan 21, 2021
caspervonb pushed a commit to caspervonb/deno_std that referenced this pull request Jan 24, 2021
caspervonb pushed a commit to caspervonb/deno_std that referenced this pull request Jan 24, 2021
caspervonb pushed a commit to caspervonb/deno_std that referenced this pull request Jan 24, 2021
caspervonb pushed a commit to caspervonb/deno_std that referenced this pull request Jan 31, 2021
caspervonb pushed a commit to caspervonb/deno_std that referenced this pull request Jan 31, 2021
caspervonb pushed a commit to caspervonb/deno_std that referenced this pull request Jan 31, 2021
caspervonb pushed a commit to caspervonb/deno_std that referenced this pull request Jan 31, 2021
caspervonb pushed a commit to caspervonb/deno_std that referenced this pull request Feb 1, 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