Skip to content

Commit

Permalink
Detect new spago projects (#80)
Browse files Browse the repository at this point in the history
  • Loading branch information
CharlesTaylor7 committed Sep 28, 2023
1 parent 6c97778 commit 2e2f676
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/Pscid/Options.purs
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,14 @@ mkCommand cmd = do
pure $ fromMaybe buildCommand (npmSpecificCommand <|> npmBuildCommand)

isSpagoProject Effect Boolean
isSpagoProject = do
cwd ← Process.cwd
let fp = Path.concat [cwd, "spago.dhall"]
catchException (\_ → pure false) (FSSync.exists fp)
isSpagoProject = ado
dhallConfig <- exists "spago.dhall"
spagoConfig <- exists "spago.yaml"
in dhallConfig || spagoConfig
where
exists config = do
cwd ← Process.cwd
catchException (\_ → pure false) (FSSync.exists (Path.concat [cwd, config]))

-- | Accepts defaults options and
buildOptions
Expand Down

0 comments on commit 2e2f676

Please sign in to comment.