Skip to content

Commit 04db0f7

Browse files
committed
Use stack and upgrade to GHC 7.10
1 parent de2601b commit 04db0f7

File tree

5 files changed

+15
-23
lines changed

5 files changed

+15
-23
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55
dist/
66
cabal.sandbox.config
77
.cabal-sandbox/
8-
8+
.stack-work/

README.md

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -30,23 +30,13 @@ For example, if you specify two columns but your data has three, then
3030
Building
3131
--------
3232

33-
You must have
34-
35-
* [Glasgow Haskell Compiler](http://www.haskell.org/ghc/)
36-
* [Cabal](http://www.haskell.org/cabal/) (which comes with the [Haskell Platform](http://www.haskell.org/platform/))
37-
38-
Then you can
39-
40-
```bash
41-
$ cd log2sql
42-
$ cabal install
43-
```
33+
Install [stack](https://github.com/commercialhaskell/stack) and run `stack setup && stack build`.
4434

4535

4636
License
4737
-------
4838

49-
Copyright © Covenant Eyes 2014
39+
Copyright © Covenant Eyes 2015
5040

5141
This package is licensed under the [MIT license](http://opensource.org/licenses/mit-license.php)
5242
(see `LICENSE`).

log2sql.cabal

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,25 @@
1-
-- Initial log2sql.cabal generated by cabal init. For further
1+
-- Initial log2sql.cabal generated by cabal init. For further
22
-- documentation, see http://haskell.org/cabal/users-guide/
33

44
name: log2sql
5-
version: 0.2.1.0
5+
version: 0.2.1.1
66
synopsis: Places program logs into SQL for better querying
7-
-- description:
7+
-- description:
88
license: MIT
99
license-file: LICENSE
1010
author: Elliot Cameron
1111
maintainer: [email protected]
1212
copyright: Covenant Eyes 2014
1313
category: Development
1414
build-type: Simple
15-
-- extra-source-files:
15+
-- extra-source-files:
1616
cabal-version: >=1.10
1717

1818
executable log2sql
1919
main-is: Main.hs
20-
-- other-modules:
21-
-- other-extensions:
20+
other-modules: Converter
21+
22+
-- other-extensions:
2223
build-depends: base >=4.6 && <5,
2324
filepath,
2425
optparse-applicative,
@@ -27,4 +28,3 @@ executable log2sql
2728
hs-source-dirs: src
2829
default-language: Haskell2010
2930
ghc-options: -O2
30-

src/Converter.hs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ runWith (Options name outf fields delim) xs = withConnection fileName $ \c -> do
5353
where
5454
fileName = T.unpack outf
5555
tableName = name `enclosedBy` "\""
56-
56+
5757
createQuery = toQ $ "CREATE TABLE IF NOT EXISTS " <> tableName <> " " <> columnDef
5858

5959
columnDef = "(id INTEGER PRIMARY KEY, " <> T.intercalate ", " (sqlColumn <$> fields) <> ")"
@@ -67,8 +67,7 @@ runWith (Options name outf fields delim) xs = withConnection fileName $ \c -> do
6767

6868
parseLine :: Text -> [Text]
6969
parseLine x = clean <$> limitedSplitOn (length fields) delim x
70-
where clean = T.dropAround (`elem` " \"'")
70+
where clean = T.dropAround (`elem` (" \"'" :: String))
7171

7272
handleError :: Int -> FormatError -> IO ()
7373
handleError idx e = hPutStrLn stderr $ "Error on line " ++ show idx ++ ": " ++ show e
74-

stack.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
packages:
2+
- '.'
3+
resolver: lts-3.4

0 commit comments

Comments
 (0)