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

Powershell - Windows - Fix resolving commands that do not have an exe file #52

Closed
wants to merge 2 commits into from

Conversation

dsherret
Copy link

@dsherret dsherret commented Feb 17, 2021

On Windows, the current powershell implementation assumes the command will resolve to a file with an .exe extension, but the file may be a .bat, .ps1, .cmd, or other type of executable.

  • In 368348a, I have an implementation that does a check for the existence of a .exe extension and prefers that.
  • After in d7c390b, I removed most of this since I don't believe it's necessary. I'm not sure why the exe check exists because windows will not execute a node file and it prefers executing node.exe when writing node. Also, why are Linux and Windows builds in the same directory (see what the comment said)? Perhaps this is too much of a breaking change or I am mistaken here, so let me know.

References

Closes #51

@@ -50,7 +50,7 @@ test('fails if from doesnt exist', t => {
test('fails if mkdir fails', t => {
var from = path.resolve(fixtures, 'from.env')
var to = path.resolve(fixtures, 'from.env/a/b/c')
return t.rejects(cmdShim(from, to), { code: /^(ENOTDIR|EEXIST)$/ })
return t.rejects(cmdShim(from, to), { code: /^(ENOTDIR|EEXIST|ENOENT)$/ })
Copy link
Author

@dsherret dsherret Feb 17, 2021

Choose a reason for hiding this comment

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

I needed to add this to get the tests to pass on Windows. Let me know if I should revert this.

@dsherret
Copy link
Author

dsherret commented Aug 4, 2021

Anything I can do to help move this forward?

@dsherret dsherret closed this Feb 15, 2023
@dsherret dsherret deleted the powershell_support_no_exe branch February 15, 2023 01:12
@Kishan-ui20
Copy link

I think that the problem is with the node version so kindly check whether your project is adopatable to which version of node and process it further, hence it worked for me if its wrong pls leave comment

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.

[FEATURE] Powershell - Windows - Handle node.exe not on path, but node existing similar to cmd shims
2 participants