embed files in the bin

This commit is contained in:
Yann Esposito (Yogsototh) 2018-08-31 11:44:36 +02:00
parent 2dbfb4bbd7
commit e9f057db55
Signed by untrusted user who does not match committer: yogsototh
GPG key ID: 7B19A4C650D59646
3 changed files with 17 additions and 13 deletions

View file

@ -2,12 +2,13 @@
--
-- see: https://github.com/sol/hpack
--
-- hash: a686a36064ef8ecb9b6b995eff90b19c3c02223326995cc6f0ae33c7f7d699f5
-- hash: 33fb8dc1910b29dc2948850dc3ab52f6a6c420a93c0113d1fc81076fcd555c3a
name: gpm
version: 0.1.0.0
category: Test
stability: alpha (experimental)
homepage: https://gitlab.esy.fun/yogsototh/gpm
author: Yann Esposito
maintainer: yann.esposito@gmail.com
copyright: © 2017 Yann Esposito
@ -30,6 +31,7 @@ library
ghc-options: -O2 -Werror -Wall -Wcompat -Wincomplete-uni-patterns -Wredundant-constraints -Wnoncanonical-monad-instances
build-depends:
base >=4.8 && <5
, file-embed
, protolude
, turtle
default-language: Haskell2010
@ -44,6 +46,7 @@ executable gpm
ghc-options: -O2 -Werror -Wall -Wcompat -Wincomplete-uni-patterns -Wredundant-constraints -Wnoncanonical-monad-instances -threaded -rtsopts -with-rtsopts=-N -optP-Wno-nonportable-include-path
build-depends:
base >=4.8 && <5
, file-embed
, gpm
, protolude
, turtle

View file

@ -5,7 +5,7 @@ author: Yann Esposito
maintainer: yann.esposito@gmail.com
copyright: © 2017 Yann Esposito
license: ISC
url: https://gitlab.esy.fun/yogsototh/gpm
homepage: https://gitlab.esy.fun/yogsototh/gpm
default-extensions:
- OverloadedStrings
- NoImplicitPrelude
@ -26,6 +26,7 @@ dependencies:
- base >=4.8 && <5
- protolude
- turtle
- file-embed
library:
source-dirs: src
executables:

View file

@ -1,19 +1,22 @@
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TemplateHaskell #-}
module GPM
where
import Protolude hiding (stdout,(%),die)
import Turtle
import Data.FileEmbed (embedStringFile)
import Protolude hiding (die, stdout, (%))
import Turtle
import GPM.Review (handleReview,ReviewCommand(..),parseReviewCmd)
import GPM.Review (ReviewCommand (..), handleReview,
parseReviewCmd)
gpm :: IO ()
gpm = do
subcmd <- options "Git Project Manager" parser
case subcmd of
Init -> init
NewIssue -> newIssue
Init -> init
NewIssue -> newIssue
Review reviewCmd -> handleReview reviewCmd
data Command = Init
@ -55,15 +58,13 @@ debug cmd = do
initIssues :: IO ()
initIssues = do
echo "* issue.org"
input ("templates" </> "issues.org")
& output "issues.org"
output "issues.org" $(embedStringFile "templates/issues.org")
debug "git add issues.org"
initDocs :: IO ()
initDocs = do
echo "* wiki.org"
input ("templates" </> "wiki.org")
& output "wiki.org"
output "wiki.org" $(embedStringFile "templates/wiki.org")
debug "git add wiki.org"
initReview :: IO ()
@ -71,6 +72,5 @@ initReview = do
let fic = "reviews" </> "write-contributing-yogsototh.org"
mktree "reviews"
putText $ format ("* "%fp) fic
input ("templates" </> "review.org")
& output fic
output fic $(embedStringFile "templates/review.org")
debug "git add reviews"