summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvmchale <>2017-10-15 19:52:00 (GMT)
committerhdiff <hdiff@hdiff.luite.com>2017-10-15 19:52:00 (GMT)
commit03188c191264611e5640a5ef93ac81070402ee50 (patch)
treec4dd9b4493ae96b24f150ab5de631ef8c4fcdddc
parentc9f615bfcb35f4e8829ed929ec998628249d2158 (diff)
version 0.1.0.90.1.0.9
-rw-r--r--.travis.yml3
-rw-r--r--README.md13
-rw-r--r--src/Toml/Checker.hs6
-rw-r--r--tomlcheck.cabal2
4 files changed, 22 insertions, 2 deletions
diff --git a/.travis.yml b/.travis.yml
index 7a0b907..fd3bc3d 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -49,6 +49,9 @@ script:
- echo $BINPATH
- mv $BINPATH tomlcheck-$TARGET
- ls tomlcheck-$TARGET
+ - wget https://github.com/vmchale/tomlcheck/releases/download/0.1.0.8/tomlcheck-x86_64-unkown-linux-gnu -O tomlcheck
+ - chmod a+x tomlcheck
+ - ./tomlcheck --file data/sample.toml
deploy:
api_key:
diff --git a/README.md b/README.md
index 311a04f..c61aea4 100644
--- a/README.md
+++ b/README.md
@@ -24,3 +24,16 @@ Install [GHC](https://www.haskell.org/ghc/download.html) along with
$ cabal update
$ cabal install tomlcheck
```
+
+## Use
+
+### Travis
+
+A sample script for your `.travis.yml` file:
+
+```yaml
+test:
+ - wget https://github.com/vmchale/tomlcheck/releases/download/0.1.0.8/tomlcheck-x86_64-unkown-linux-gnu -O tomlcheck
+ - chmod a+x tomlcheck
+ - ./tomlcheck --file data/sample.toml
+```
diff --git a/src/Toml/Checker.hs b/src/Toml/Checker.hs
index 8a973d5..051ec81 100644
--- a/src/Toml/Checker.hs
+++ b/src/Toml/Checker.hs
@@ -10,6 +10,7 @@ module Toml.Checker
import qualified Data.Text.IO as TIO
import GHC.Generics (Generic)
import Options.Generic
+import System.Exit (ExitCode (..), exitWith)
import Text.Megaparsec (parseErrorPretty)
import Text.Toml (parseTomlDoc)
@@ -29,4 +30,7 @@ exec = do
contents <- TIO.readFile path
case parseTomlDoc path contents of
Right _ -> pure ()
- Left e -> putStrLn $ parseErrorPretty e
+ Left e -> do
+ putStrLn $ parseErrorPretty e
+ exitWith (ExitFailure 1)
+
diff --git a/tomlcheck.cabal b/tomlcheck.cabal
index ffed66f..319b2e1 100644
--- a/tomlcheck.cabal
+++ b/tomlcheck.cabal
@@ -1,5 +1,5 @@
name: tomlcheck
-version: 0.1.0.8
+version: 0.1.0.9
synopsis: Command-line tool to check syntax of TOML files
description: This is a command-line wrapper around htoml-megaparsec.
It is intended to be used as a syntax checker that can be