Skip to content

Instantly share code, notes, and snippets.

@chrisdone
Created October 18, 2014 21:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chrisdone/305589d08c099d241b9c to your computer and use it in GitHub Desktop.
Save chrisdone/305589d08c099d241b9c to your computer and use it in GitHub Desktop.
import Data.Conduit.Shell
import qualified Data.Conduit.Shell.Segments as SH
main =
run (do hsenv
cur:_ <- SH.strings latestStackage
sed ("s/remote-repo:.*/remote-repo: stackage:http:\\/\\/www.stackage.org\\/stackage\\/" ++
cur ++ "/")
".hsenv/cabal/config"
"-i"
bash "-c"
"source .hsenv/bin/activate; exec cabal update"
bash "-c"
"source .hsenv/bin/activate; exec cabal install --dry-run")
latestStackage =
curl "-s" "http://www.stackage.org/alias/fpcomplete/unstable-ghc78-inclusive" "-D/dev/stdout" $|
egrep "-o" "stackage\\.org/stackage/[a-z0-9]+" $|
egrep "-o" "[a-z0-9]+$"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment