Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Build.idr
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ compile (Node (ident, config) deps) = case (isLegacy ident.source) of
depends = depNames,
modules = config.modules,
main = config.main,
exec = "main" <$ config.main,
exec = config.executable,
passthru = config.passthru
}

Expand Down
3 changes: 2 additions & 1 deletion src/Package/Description.idr
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,13 @@ record Description where
deps : List (Identifier MaybePinned)
modules : List String -- Need a better type for module names maybe?
main : Maybe String
executable : Maybe String
passthru : List (String, String)


export
emptyDescription : Description
emptyDescription = MkDescription [] [] Nothing []
emptyDescription = MkDescription [] [] Nothing Nothing []


public export
Expand Down
5 changes: 4 additions & 1 deletion src/Package/Description/Parse.idr
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,14 @@ pDescription s = case parse s of
-- JSON. Equally, if the key isn't present, then that should be fine too.
let main = parseMain <$> lookup "main" obj
main <- sequence main
exec <- case main of
Nothing => pure Nothing
Just _ => Just <$> (lookup' "executable" obj >>= getStr)

let pthru = catMaybes . sequence $
(lookup "passthru" obj >>= parsePassthru)

pure $ (pkgName, MkDescription deps mods main pthru)
pure $ (pkgName, MkDescription deps mods main exec pthru)
parseDescription x = Left "Expected config object, instead got \{show x}"

parseMultiDescription : JSON -> P MultiDescription
Expand Down