aboutsummaryrefslogtreecommitdiffhomepage
path: root/scripts/scaffolder.sh
blob: a7121f7a24333b9360d32f90a84dd449007a3724 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/usr/bin/env bash

HERE="$(dirname "$0")"

REVISION="D96A"
if [ -n "$1" ]
then
  REVISION=$1
  shift 1
fi

function specification {
  stack exec edi-parser-scaffolder -- \
    scaffold --revision "$REVISION" \
      --src "$HERE/../src" \
      --specification "$HERE/../specification"
}

function missing {
  echo "$1 is missing. Aborting."
  exit 1
}

function checkRequirements {
  command -v stylish-haskell > /dev/null || missing "stylish-haskell"
}

checkRequirements
specification