hpastetwo

cabal-install-github

author
Tom Lokhorst
age
436 days
language
bash
 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
30
31
#!/bin/bash
# Install a Haskell project directly from github
#
# - Tom Lokhorst, 2009

username=$1
project=$2
clean=$3

if [ $# -lt 2 ]
then
  echo Usage: `basename $0` USERNAME PROJECT [--clean] [cabal options]
else
  git clone git://github.com/$username/$project.git
  cd $project

  shift
  shift
  if [ "$clean" == "-c" ] || [ "$clean" == "--clean" ]
  then
    shift
  fi

  cabal install $@

  if [ "$clean" == "-c" ] || [ "$clean" == "--clean" ]
  then
    cd ..
    rm -rf $project
  fi
fi