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

improve 'stack new' #1532

Merged
merged 9 commits into from
Dec 21, 2015
Merged

Conversation

kadoban
Copy link
Collaborator

@kadoban kadoban commented Dec 17, 2015

  • You can now specify an explicit URL to download the template from
  • I've improved the logging/output so that it doesn't say it's "Downloading" a local file
  • You can specify a default-template in ~/.stack/config.yaml, which is nice if you have a favorite

I considered adding the ability to configure the template repository location, but I'm thinking I might leave that for a separate PR later if it sounds interesting to anyone. I think it'd be a decent feature, but it's a little complicated by the existence of the stack templates command, which I haven't really worked out how to deal with.

I'm working on some tests to exercise this functionality and make sure, but it basically seems to work fine to me.

exists <- fileExists path
unless exists ($logDebug "Template file doesn't exist")
Copy link
Contributor

Choose a reason for hiding this comment

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

Are these $logDebugs intended to be visible to the user? They'll only be present in the -v output.

It probably makes sense to delete this one since it's a bit redundant with the exception. But perhaps it helps resolve ambiguity when debugging?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ah yeah, that is quite redundant now. I'll nuke it. (I think it exists from when I was doing my own debug briefly and just forgot to remove it)

@mgsloan
Copy link
Contributor

mgsloan commented Dec 18, 2015

LGTM!

I considered adding the ability to configure the template repository location, but I'm thinking I might leave that for a separate PR later if it sounds interesting to anyone. I think it'd be a decent feature, but it's a little complicated by the existence of the stack templates command, which I haven't really worked out how to deal with.

Yeah, this would be nice, particularly if a file URL would just use a folder for the templates. I think it might make sense to change how templates are done, in order to support this + to work offline: #1251 (comment)

Of course, that's bonus points, merging this isn't predicated on doing that.

@kadoban
Copy link
Collaborator Author

kadoban commented Dec 18, 2015

LGTM!

Yay :)

I considered adding the ability to configure the template repository location, but I'm thinking I might leave that for a separate PR later if it sounds interesting to anyone. I think it'd be a decent feature, but it's a little complicated by the existence of the stack templates command, which I haven't really worked out how to deal with.

Yeah, this would be nice, particularly if a file URL would just use a folder for the templates. I think it might make sense to change how templates are done, in order to support this + to work offline: #1251 (comment)

Yeah I agree, that sounds like quite a nice way to go. I'll ponder a bit and respond in that thread if anything interesting comes to mind. I'd be interested in working on improving new more in that direction if someone else doesn't get to it first (but they might, it'll probably be a few days before I have time).

Of course, that's bonus points, merging this isn't predicated on doing that.

Cool. Yeah I'd say most/all of this should end up useful even once something in that direction gets implemented, if only because requiring git probably isn't ideal (so it has to work without it at least in some fashion).

mgsloan added a commit that referenced this pull request Dec 21, 2015
@mgsloan mgsloan merged commit c813c83 into commercialhaskell:master Dec 21, 2015
@kadoban kadoban deleted the new-command-url branch December 21, 2015 04:02
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