Skip to content

Instantly share code, notes, and snippets.

@dysinger
Last active February 5, 2016 08:01
Show Gist options
  • Select an option

  • Save dysinger/eaf28dd6959883a7750c to your computer and use it in GitHub Desktop.

Select an option

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
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