Skip to content

Commit

Permalink
[ fix agda#370 ] add locate command, data-files in cabal config
Browse files Browse the repository at this point in the history
  • Loading branch information
flupe committed Oct 1, 2024
1 parent a5552b6 commit ab3bd6a
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
5 changes: 4 additions & 1 deletion agda2hs.cabal
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cabal-version: 2.2
cabal-version: 2.4
name: agda2hs
version: 1.3
license: BSD-3-Clause
Expand All @@ -18,6 +18,9 @@ description:
extra-doc-files: CHANGELOG.md
README.md

data-files: agda2hs.agda-lib
lib/**/*.agda

source-repository head
type: git
location: https://github.com/agda/agda2hs.git
Expand Down
19 changes: 13 additions & 6 deletions src/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import Agda2Hs.Config ( checkConfig )
import Agda2Hs.Compile.Types
import Agda2Hs.Render

import Paths_agda2hs ( version )
import Paths_agda2hs ( version, getDataFileName )


-- | Agda2Hs default config
Expand Down Expand Up @@ -87,8 +87,15 @@ isInteractive = do
return $ not $ null i

main = do
-- Issue #201: disable backend when run in interactive mode
isInt <- isInteractive
if isInt
then runAgda [Backend backend{isEnabled = const False}]
else runAgda [Backend backend]
args <- getArgs

-- Issue #370: `agda2hs locate` will print out the path to the prelude agda-lib file
if args == ["locate"] then
putStrLn =<< getDataFileName "agda2hs.agda-lib"
else do
-- Issue #201: disable backend when run in interactive mode
isInt <- isInteractive

if isInt
then runAgda [Backend backend{isEnabled = const False}]
else runAgda [Backend backend]

0 comments on commit ab3bd6a

Please sign in to comment.