Last active
February 5, 2016 08:01
-
-
Save dysinger/eaf28dd6959883a7750c to your computer and use it in GitHub Desktop.
Bash/Zsh function for creating a Dash.app docset from a stack project
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function stack-docset | |
| { | |
| # NOTE: This function assumes you already ran `stack build --haddock` | |
| HC_PKG=ghc-pkg | |
| if [ -z $(stack path|grep ghc-package-path|grep -v ghcjs) ]; then HC_PKG=ghcjs-pkg; fi | |
| DOCSET=$(basename $PWD).docset | |
| rm -rf $DOCSET || true | |
| stack build --haddock | |
| stack exec -- haddocset --hc-pkg=$HC_PKG -t $DOCSET create | |
| stack exec -- haddocset --hc-pkg=$HC_PKG -t $DOCSET add $(stack path --local-pkg-db)/*.conf | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment