Skip to content

Commit

Permalink
try smarter
Browse files Browse the repository at this point in the history
  • Loading branch information
sheaf committed Jan 13, 2025
1 parent 7d66de5 commit 65eb9e7
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions c-expr/test/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ import CallClang

--------------------------------------------------------------------------------

findPackageDirectory :: FilePath -> String -> IO FilePath
findPackageDirectory cwd pkgname = try attempts
findPackageDirectory :: String -> IO FilePath
findPackageDirectory pkgname = try attempts
where
try :: [FilePath] -> IO FilePath
try [] =
Expand All @@ -87,19 +87,14 @@ findPackageDirectory cwd pkgname = try attempts
else Nothing
attempts :: [FilePath]
attempts =
[ cwd
, cwd </> pkgname
, cwd </> ".."
, cwd </> ".." </> pkgname
, cwd </> ".." </> ".."
, cwd </> ".." </> ".." </> pkgname
[ "."
, pkgname
]

main :: IO ()
main = do

cwd <- getCurrentDirectory
hsBindgenDir <- findPackageDirectory cwd "hs-bindgen"
hsBindgenDir <- findPackageDirectory "hs-bindgen"

let platform = buildPlatform
clangArgs0 =
Expand Down

0 comments on commit 65eb9e7

Please sign in to comment.