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: Command cannot be executed on Windows #458

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Losses
Copy link

@Losses Losses commented Jun 14, 2024

Summary

This pull request introduces platform-specific adjustments to the ICommandShell class within the Jennifer::Adapter module. These changes ensure compatibility with both Windows and Unix-like systems by conditionally modifying command execution behavior and related constants.

Changes Made

  1. Platform-Specific Constants:

    • OPTIONS_PLACEHOLDER is now conditionally set based on the operating system. For Windows (win32), it is an empty string, while for other systems, it remains as %("${@}").
    • SUDO is conditionally set to an empty string for Windows and "sudo" for Unix-like systems.
  2. Command Execution Logic:

    • The invoke method now uses platform-specific logic to execute commands. On Windows, it uses cmd /c to run the command, whereas on Unix-like systems, it uses the shell directly.

Testing

  • Windows: Verified that commands execute correctly using cmd /c.

Notes

  • Further testing and validation are recommended to ensure robustness across different environments and scenarios.

@imdrasil
Copy link
Owner

Thank you for contribution 👍 I'll take a look at all your suggestions by the end of this week

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.

None yet

2 participants