Commit 06e36cb2 authored by Michael Herold's avatar Michael Herold

A bit of separation

parent ff1602e3
Pipeline #579 passed with stage
in 11 minutes and 20 seconds
......@@ -6,11 +6,15 @@ update:
cabal install -ffast --allow-newer --force-reinstalls --only-dependencies --disable-optimization
test:
cabal clean
cabal configure --disable-optimization --enable-coverage --enable-tests
#cabal build --ghc-options="-Wall -fwarn-incomplete-record-updates -fno-warn-orphans"
#cabal build
cabal test --show-details direct
cabal build
-rm tests/hamsql.tix
-rm -r tests/coverage
-rm tests/hamsql-stmt-log.sql
make -C tests
hpc report tests/hamsql.tix --hpcdir dist/hpc/vanilla/mix/hamsql
hpc markup tests/hamsql.tix --hpcdir dist/hpc/vanilla/mix/hamsql/ --destdir=tests/coverage --verbosity=0
doc:
cabal haddock
......
import System.Exit (ExitCode(ExitSuccess))
import System.Process (system)
module Main where
import Database.HamSql.Cli
main :: IO ()
main = do
ExitSuccess <- system "make -C tests"
return ()
exec ["--help"]
where exec xs = parseThisArgv xs >>= run
......@@ -30,6 +30,7 @@ library
TemplateHaskell
exposed-modules:
Database.HamSql
Database.HamSql.Cli
Database.HamSql.Setup
Database.YamSql
Database.YamSql.Parser
......@@ -68,7 +69,6 @@ library
Database.YamSql.Internal.Trigger
Database.YamSql.Internal.Type
build-depends:
base >=4.8,
text >=1.2 && <1.3,
......@@ -88,24 +88,18 @@ library
groom >=0.1 && < 0.2
executable hamsql
main-is: HamSql.hs
main-is: hamsql.hs
default-language: Haskell2010
default-extensions:
OverloadedStrings
build-depends:
base >=4.8,
text >=1.2 && <1.3,
network-uri >=2.6 && <2.7,
optparse-applicative >=0.13 && <0.14,
hamsql
test-suite hamsql-tests
default-language: Haskell2010
type: exitcode-stdio-1.0
main-is: hamsql-tests.hs
build-depends: base, process
build-depends: base, hamsql
source-repository head
type: git
......
-- This file is part of HamSql
--
-- Copyright 2014-2016 by it's authors.
-- Some rights reserved. See COPYING, AUTHORS.
module Main where
import Database.HamSql.Cli
main :: IO ()
main = parseArgv >>= run
......@@ -2,7 +2,7 @@
--
-- Copyright 2014-2016 by it's authors.
-- Some rights reserved. See COPYING, AUTHORS.
module Main where
module Database.HamSql.Cli (run, parseArgv, parseThisArgv) where
import Control.Monad (void, when)
import Data.List
......@@ -11,13 +11,20 @@ import Data.Maybe
import qualified Data.Text as T
import qualified Data.Text.IO as T.IO
import Network.URI
import Options.Applicative (execParser)
import Options.Applicative hiding ( info)
import System.Environment (getArgs)
import Database.HamSql
import Database.YamSql
main :: IO ()
main = execParser parserInfoHamsql >>= run
parserPrefs :: ParserPrefs
parserPrefs = defaultPrefs { prefShowHelpOnEmpty = True }
parseArgv :: IO Command
parseArgv = getArgs >>= parseThisArgv
parseThisArgv :: [String] -> IO Command
parseThisArgv xs = handleParseResult $ execParserPure parserPrefs parserInfoHamsql xs
run :: Command -> IO ()
-- Install
......
This diff is collapsed.
#!/bin/bash
../../dist/build/hamsql/hamsql install -d --permit-data-deletion -v -c postgres://postgres@/hamsql-test -s $1
#!/bin/bash
../../dist/build/hamsql/hamsql upgrade --permit-data-deletion -v -c postgres://postgres@/hamsql-test -s $1
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment