-
Notifications
You must be signed in to change notification settings - Fork 134
Description
Possibly related to #276.
We have nonstandard sources in some of our spago.dhall files, and we want to use pscid in our projects. At the moment we have something along the lines of this in our package.json file:
"pscid": "set -o noglob && pscid -I $(npm run --silent sources:purs:directories | tr '\\n' ';')",
"sources:purs": "spago sources | sed '/*.purs/!d' && echo 'web/src/purs/**/*.purs' && printf 'more-sources/**/*.purs'",
"sources:purs:directories": "npm run --silent sources:purs | sed 's|/\\*\\*/\\*.purs||'"
so that sources:purs prints out a list of globs, sources:purs:directories strips the trailing **/*.purs, and then we use tr to join all of those directories together with ; and pass that to pscid, because pscid expects a list of directory names (not globs) separated by ;.
I would quite like to get rid of the sources:purs script and have this list of directories stored in the sources key of our spago.dhall files, but I wasn't able to come up with an easy way of getting this information out of spago.dhall without involving jq and dhall-to-json.
If spago sources could include any extra sources listed in spago.dhall this would be fairly straightforward to achieve. Perhaps it would make sense to include these only if a --with-local flag is passed or something, so as not to be a breaking change?