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

Fix for wrong OS detection in Windows Subsystem for Linux #521

Closed
wants to merge 4 commits into from

Conversation

christian-wtd
Copy link
Contributor

@christian-wtd christian-wtd commented Sep 25, 2019

This fixes the wrong OS detection in Windows Subsystem for Linux (WSL)

Description

We earlier detected windows because running cmd.exe works in WSL but we can detect that by running "which cmd.exe" which gives commadn not found in windows because which is a linux command.

Related Issue

#520
inspec/inspec#4310 (potentially)

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New content (non-breaking change)
  • Breaking change (a content change which would break existing functionality or processes)

Checklist:

  • I have read the CONTRIBUTING document.

Signed-off-by: christian-wtd <[email protected]>
@chef-expeditor
Copy link
Contributor

Hello christian-wtd! Thanks for the pull request!

Here is what will happen next:

  1. Your PR will be reviewed by the maintainers.
  2. Possible Outcomes
    a. If everything looks good, one of them will approve it, and your PR will be merged.
    b. The maintainer may request follow-on work (e.g. code fix, linting, etc). We would encourage you to address this work in 2-3 business days to keep the conversation going and to get your contribution in sooner.
    c. Cases exist where a PR is neither aligned to Chef InSpec's product roadmap, or something the team can own or maintain long-term. In these cases, the maintainer will provide justification and close out the PR.

Thank you for contributing!

Signed-off-by: christian-wtd <[email protected]>
cmon... your rubocop does exact opposite offenses than mine...

Signed-off-by: christian-wtd <[email protected]>
@christian-wtd
Copy link
Contributor Author

Alright, my initial approach was fixing WSL but breaking evrything else :-(
Fixed that!

@christian-wtd
Copy link
Contributor Author

Oh btw...
Your Rubocop makes opposite offenses than mine (0.74.0).
Even Code Climate agrees and suggests to use single quotes, which my rubocop does too and yours offenses...

@christian-wtd
Copy link
Contributor Author

christian-wtd commented Sep 25, 2019

In addition to the original bug this may fix also
inspec/inspec#4310

@codeclimate
Copy link

codeclimate bot commented Oct 18, 2019

Code Climate has analyzed commit 7d0fef6 and detected 2 issues on this pull request.

Here's the issue category breakdown:

Category Count
Complexity 1
Style 1

View more on Code Climate.

@zenspider
Copy link
Contributor

Sorry, but WSL is not a supported platform and isn't on our radar.

@zenspider zenspider closed this Dec 9, 2019
@bohdanyurov-gl
Copy link

@zenspider Fix takes two lines, why can't we add it? What is the possible negative impact?

@Schwad
Copy link

Schwad commented Sep 21, 2020

@bohdanyurov-gl We don't actively track closed PRs/issues so comments like this are easily lost in the ether.

I know it's been most of a year since this PR was filed, if you'd like to continue the discussion feel free to file an issue :)

I personally have no problem with WSL but someone from @inspec/foundation-team-reviewers may have more background on this than me. Thanks!

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.

4 participants