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

Shelly automatically appends ".exe" on command names #165

Open
eric-corumdigital opened this issue Feb 27, 2018 · 2 comments
Open

Shelly automatically appends ".exe" on command names #165

eric-corumdigital opened this issue Feb 27, 2018 · 2 comments

Comments

@eric-corumdigital
Copy link
Contributor

eric-corumdigital commented Feb 27, 2018

A snippet from the source code:

-- | Get a full path to an executable by looking at the @PATH@ environement
-- variable. Windows normally looks in additional places besides the
-- @PATH@: this does not duplicate that behavior.
whichEith :: FilePath -> Sh (Either String FilePath)
whichEith originalFp = whichFull
#if defined(mingw32_HOST_OS)
    $ case extension originalFp of
        Nothing -> originalFp <.> "exe"
        Just _ -> originalFp
#else
    originalFp
#endif

I am guessing this is an attempt to work somewhat like how Windows usually looks for executables. I do not see any non-breaking way to change how whichEith works, but here are two ideas:

  1. Do nothing to the file path, regardless of OS. This requires Shelly users to append .exe themselves.
  2. First try and find the file without the .exe suffix. If that fails, try and find the file with the .exe suffix. Maybe this causes the wrong executable to be used.

I would happily send in a PR for either of these but because it is a breaking change either way I assume it wants to be discussed.

Related to #112

@gregwebs
Copy link
Owner

I like option 2 as a solution.

@gregwebs
Copy link
Owner

The third option, which would not be breaking would be to look for the .exe first, and if not found look without the .exe

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

No branches or pull requests

2 participants