#!/bin/sh
### You can call this script like so to generate a dependency graph
### of the `Data.List.Base` module:
### ./graph.sh src/Data/List/Base.agda
### Allow users to pick the agda executable they want by prefixing
### the call with `AGDA=agda-X.Y.Z` and default to agda in case
### nothing was picked
AGDA=
### Grab the directory and name of the target agda file
DIR=
BASE=
FILE=_build//
### Prepare the directory for the dot & tmp files
### Generate the dot file for the target agda file
### Trim the graph to remove transitive dependencies. Without that the
### graphs get too big too quickly and are impossible to render
### Generate an svg representation of the graph
### Add a symlink to it in the base directory