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

Fix cli parsing #38

Merged
merged 3 commits into from
Jun 12, 2024
Merged
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 .github/workflows/ci-ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ on:
########################################################################

env:
IDRIS2_COMMIT: 24ac56de8809ae7a2cd0126f01110d4b762389fc
IDRIS2_COMMIT: 9e84b153bd3d7d5a63ec9e6a9adfa47a067ea172
COLLIE_COMMIT: ed2eda5e04fbd02a7728e915d396e14cc7ec298e
IDRALL_COMMIT: 62a455894b1db5134c8b56d31aadb31d483a4b2c
SCHEME: scheme
Expand Down
1 change: 1 addition & 0 deletions src/Katla/CLI.idr
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import Katla.HTML
import Katla.Engine

%default covering
%hide Collie.Modifiers.infix.(::=)

failWithUsage : {nm : _} -> Command nm -> IO ()
failWithUsage cmd
Expand Down
5 changes: 4 additions & 1 deletion src/Katla/Config.idr
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,10 @@ export
getConfiguration : Backend -> (configFile : Maybe String) -> IO Config
getConfiguration backend Nothing = pure $ defaultConfig backend
getConfiguration backend (Just filename) = do
Right config <- liftIOEither (deriveFromDhallString {ty = Config} filename)
Right fileContent <- readFile filename
| Left err => putStrLn "Error reading file: \{show err}"
>> exitFailure
Right config <- liftIOEither (deriveFromDhallString {ty = Config} fileContent)
| Left err => do putStrLn """
Error while parsing configuration file \{filename}:
\{show err}
Expand Down
2 changes: 2 additions & 0 deletions src/Katla/LaTeX.idr
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import System.File
import Collie
import Katla.Config

%hide Collie.Modifiers.infix.(::=)

export
escapeLatex : Char -> List Char
escapeLatex '-' = fastUnpack "\\KatlaDash{}"
Expand Down
2 changes: 1 addition & 1 deletion tests/examples/init/run
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ rm -rf temp
mkdir temp
# Test Katla
$1 latex init | tee temp/generated.dhall
$1 latex preamble --config ./temp/generated.dhall | tee temp/katla-preamble.tex
$1 latex preamble --config temp/generated.dhall | tee temp/katla-preamble.tex
$1 latex preamble --config ./temp/generated.dhall temp/katla-preamble-direct.tex


Expand Down
Loading