From ba9e48cb12e6e7967b1121ea1c1867fefde271ee Mon Sep 17 00:00:00 2001 From: "Yann Esposito (Yogsototh)" Date: Fri, 1 May 2015 18:49:16 +0200 Subject: [PATCH] fix using Haskell LTS and Stackage GHC 7.10 --- holy-project.cabal | 9 ++++----- interact | 15 --------------- scaffold/interact | 15 --------------- src/HolyProject.hs | 9 +++++---- 4 files changed, 9 insertions(+), 39 deletions(-) delete mode 100755 interact delete mode 100755 scaffold/interact diff --git a/holy-project.cabal b/holy-project.cabal index 83b84e9..75cec56 100644 --- a/holy-project.cabal +++ b/holy-project.cabal @@ -2,18 +2,18 @@ -- see http://haskell.org/cabal/users-guide/ name: holy-project -version: 0.1.1.2 +version: 0.2.0.0 synopsis: Start your Haskell project with cabal, git and tests. description: Holy Project is an application wich ask the user some questions and create files to help you starting a new Haskell project. There are example for tests using HUnit and SmallCheck - It initializes git, use cabal sandboxes, and provide - two useful scripts: \"auto-update\" and \"interact\". + It initializes git, use Haskell LTS, and provide + a useful script: \"auto-update\". homepage: http://github.com/yogsototh/holy-project license: MIT license-file: LICENSE -author: Yann Esposito (Yogsototh) +author: Yann Esposito (yogsototh) maintainer: Yann.Esposito@gmail.com -- copyright: category: Development @@ -23,7 +23,6 @@ data-files: scaffold/LICENSE , scaffold/Setup.hs , scaffold/auto-update , scaffold/gitignore - , scaffold/interact , scaffold/project.cabal , scaffold/src/Main.hs , scaffold/src/ModuleName.hs diff --git a/interact b/interact deleted file mode 100755 index 6def2dd..0000000 --- a/interact +++ /dev/null @@ -1,15 +0,0 @@ -#!/usr/bin/env zsh - -packagedir=( ./.cabal-sandbox/*.conf.d(/N) ) -(( ${#packagedir} == 0 )) && { - print -- "Error no package found in sandbox" - print -- "Please us cabal sandbox init" - exit 1 -}>&2 -(( ${#packagedir} > 1 )) && { - print -- "Error Too many packages:" - print -l -- $packagedir - exit 1 -}>&2 -export GHC_PACKAGE_PATH=$packagedir/: -GHC_PACKAGE_PATH=$packagedir/: ghci diff --git a/scaffold/interact b/scaffold/interact deleted file mode 100755 index 6def2dd..0000000 --- a/scaffold/interact +++ /dev/null @@ -1,15 +0,0 @@ -#!/usr/bin/env zsh - -packagedir=( ./.cabal-sandbox/*.conf.d(/N) ) -(( ${#packagedir} == 0 )) && { - print -- "Error no package found in sandbox" - print -- "Please us cabal sandbox init" - exit 1 -}>&2 -(( ${#packagedir} > 1 )) && { - print -- "Error Too many packages:" - print -l -- $packagedir - exit 1 -}>&2 -export GHC_PACKAGE_PATH=$packagedir/: -GHC_PACKAGE_PATH=$packagedir/: ghci diff --git a/src/HolyProject.hs b/src/HolyProject.hs index 56f8fa9..0882e9f 100644 --- a/src/HolyProject.hs +++ b/src/HolyProject.hs @@ -196,13 +196,14 @@ createProject p = do ] -- Change some execution access _ <- setFileMode "auto-update" ((fst . head . readOct) "777") - _ <- setFileMode "interact" ((fst . head . readOct) "777") -- Execute some commands -- We don't really need them to be succesful -- So we try them anyway _ <- system "git init ." - _ <- system "cabal sandbox init" - _ <- system "cabal install" + -- Use Haskell LTS by downloading the cabal config + _ <- system "curl -O https://www.stackage.org/snapshot/lts-2.5/cabal.config" + _ <- system "cabal install --dependencies-only --enable-tests . -j" + _ <- system "cabal build" _ <- system "cabal test" - _ <- system $ "./.cabal-sandbox/bin/test-" ++ projectName p + _ <- system $ "cabal run test-" ++ projectName p return ()