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

Do not attempt to find an executable if a script is referenced #216

Merged
merged 3 commits into from
Jan 25, 2023

Commits on Jan 24, 2023

  1. Add regression test

    adinapoli authored and andreasabel committed Jan 24, 2023
    Configuration menu
    Copy the full SHA
    d322c12 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    650e2a7 View commit details
    Browse the repository at this point in the history
  3. Simplify whichEith

    This commit simplifies the local `whichFull` function (local to `whichEith`)
    by dropping a redundant guard as well as /always/ running
    `lookupPath >>= leftPathError`. Previously we had this:
    
    ```
        whichFull fp = do
          (trace . mappend "which " . toTextIgnore) fp >> whichUntraced
          where
            whichUntraced | isAbsolute fp          = checkFile
                          | dotSlash splitOnDirs   = checkFile
                          | length splitOnDirs > 0 = lookupPath  >>= leftPathError
                          | otherwise              = lookupCache >>= leftPathError
            splitOnDirs = splitDirectories fp
    ```
    
    However `splitOnDirs` can never return the empty list, so that guard was
    redundant as that code path was always executed, and the /otherwise/
    case never executed.
    adinapoli authored and andreasabel committed Jan 24, 2023
    Configuration menu
    Copy the full SHA
    c68825e View commit details
    Browse the repository at this point in the history