Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow passing of GHC version; pull snapshot from cabal config #4

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

intercalations
Copy link

No description provided.

@masaeedu
Copy link
Owner

Nice, thank you! I'm a little concerned about the snapshot thing, because I generally want that to remain invariant until I want to upgrade (so that I can benefit from already built/downloaded derivations in new projects). Do you think it makes sense to add another optional argument for that? Or perhaps it checks for a copy of the JSON blob in the user's home dir and prefers whatever it finds there (only putting in the hardcoded defaults if not found)?

Upgrading things is a problem I don't have a good solution for at the moment. I've wanted for a while to make the tool bidirectional, so that not only can the structured data be interpolated into all the files the tool strews about, but you can also parse an existing collection of files to get structured data (which you can edit to e.g. pick a different snapshot) and then regenerate. This would also help with migrating generated repos that have been edited by hand when we want to change the template in some way.

@intercalations intercalations changed the title Allow passing of GHC version; make snapshot current Allow passing of GHC version; pull snapshot from cabal config Feb 28, 2022
Copy link
Owner

@masaeedu masaeedu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me, thank you! Optional suggestion about using an env var instead of a CLI arg, but other than that feel free to merge.

set -Eeuxo pipefail

# init-haskell location
base=$(dirname "$(readlink -f "$0")")

ghc=${1:-8.10.7}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thoughts on changing this to an env var INIT_HASKELL_GHC so people can set it in their profile (and we don't have to do arg parsing for further arguments)?

The above will default to using GHC 8.10.7. If you'd like to use a different version, simply pass the full version as an argument:

```
init-haskell 9.2.1
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you agree with the env var change:

Suggested change
init-haskell 9.2.1
INIT_HASKELL_GHC=9.2.1 init-haskell

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants