Skip to content

Commit

Permalink
[#45] Add AppVeyor config for hs-init itself
Browse files Browse the repository at this point in the history
  • Loading branch information
chshersh committed Jan 18, 2018
1 parent 91be389 commit dd11ac8
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 2 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# hs-init

[![Build status](https://secure.travis-ci.org/vrom911/hs-init.svg)](http://travis-ci.org/vrom911/hs-init)
[![Windows build status](https://ci.appveyor.com/api/projects/status/github/vrom911/hs-init?branch=master&svg=true)](https://ci.appveyor.com/project/vrom911/hs-init)
[![MIT license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/vrom911/hs-init/blob/master/LICENSE)
[![Version 1.0.2](https://img.shields.io/badge/version-v1.0.3-fabfff.svg)](https://github.com/vrom911/hs-init/blob/master/CHANGELOG.md)
[![Version 1.0.3](https://img.shields.io/badge/version-v1.0.3-fabfff.svg)](https://github.com/vrom911/hs-init/blob/master/CHANGELOG.md)

This is tool for creating completely configured production Haskell projects.
Consider that this script is using [`Stack`](http://haskellstack.org) for
Expand Down
19 changes: 19 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
build: off

before_test:
# http://help.appveyor.com/discussions/problems/6312-curl-command-not-found
- set PATH=C:\Program Files\Git\mingw64\bin;%PATH%

- curl -sS -ostack.zip -L --insecure http://www.stackage.org/stack/windows-i386
- 7z x stack.zip stack.exe

clone_folder: "c:\\stack"
environment:
global:
STACK_ROOT: "c:\\sr"

test_script:
- stack setup > nul
# The ugly echo "" hack is to avoid complaints about 0 being an invalid file
# descriptor
- echo "" | stack --no-terminal script --resolver lts-10.3 hs-init.hs -- --help
5 changes: 4 additions & 1 deletion hs-init.hs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ import System.Console.ANSI (Color (Blue, Green, Red, Yellow), ColorIntensity (Vi
SGR (Reset, SetColor, SetConsoleIntensity), setSGR)
import System.Directory (doesPathExist, getCurrentDirectory, setCurrentDirectory)
import System.FilePath ((</>))
import System.IO (hSetEncoding, stdout, utf8)
import System.Process (callCommand, readProcess, showCommandForUser)

import qualified Data.Text as T
Expand Down Expand Up @@ -83,7 +84,9 @@ endLine = "\n"
----------------------------------------------------------------------------

main :: IO ()
main = execParser prsr >>= runWithOptions
main = do
hSetEncoding stdout utf8
execParser prsr >>= runWithOptions

-- | Run 'hs-init' with cli options
runWithOptions :: InitOpts -> IO ()
Expand Down

0 comments on commit dd11ac8

Please sign in to comment.