From 1e0a546289409508a46ddf8e2f9c1b7b5d374322 Mon Sep 17 00:00:00 2001 From: "Yann Esposito (Yogsototh)" Date: Thu, 11 Aug 2016 15:39:04 +0200 Subject: [PATCH] made an unique compilation step --- README.md | 20 ++++++++++++++++++++ compile.sh | 20 ++++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100755 compile.sh diff --git a/README.md b/README.md index 36a5768..c710d17 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,27 @@ This is a stack project which implement this example Transient project: ## Usage +### Fastest + +Just open a terminal and write all these commands. +If this is the first time you use Haskell it will take a lot of time. +Don't worry, once installed, calling `compile.sh` will be fast the next time. + +~~~ +git clone http://github.com/yogsototh/transient-example +cd transient-example +./compile.sh +./start.sh +~~~ + +### Manually + 1. Install [`stack`](haskellstack.org) + + ~~~ + curl -sSL https://get.haskellstack.org/ | sh + ~~~ + 2. Install ghc and ghcjs with stack. If you never installed ghcjs that could take a _lot_ of time. diff --git a/compile.sh b/compile.sh new file mode 100755 index 0000000..eafe84a --- /dev/null +++ b/compile.sh @@ -0,0 +1,20 @@ +#!/usr/bin/env bash + +if command -v stack >/dev/null 2>&1 +then echo "stack already installed." +else + echo "stack is not installed. I will try to install it." + curl -sSL https://get.haskellstack.org/ | sh +fi + +# Downloading Haskell Compiler this can be very long +stack setup +stack --stack-yaml stack-ghcjs.yaml setup + +# Building the project the first time it will also download and compile +# library +stack build +stack --stack-yaml stack-ghcjs.yaml build + +# Link GHCJS result to the correct directory (static/out.jsexe) +./mklink.sh