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

Add --ignore-subdirs flag to init command #435

Merged
merged 1 commit into from
Jun 27, 2015

Conversation

markus1189
Copy link
Contributor

Currently stack init takes into account all .cabal files in the cwd as well as non-ignored sub directories. If I run it on the stack project it will for example also pick up the new-template.cabal
and refuse all of the available build plans due to unresolved packages like acme-dont that are used in some of the integration tests.

With the new flag stack init --ignore-subdirs it will only consider stack.cabal and not recurse into sub directories.

To allow this I added a boolean flag to findCabalFiles which I don't like that much but I avoided to define a data type for the argument (e.g data FindCabalRecurse = DoRecurse | Don'tRecurse) for simplicity.

@@ -275,7 +275,7 @@ loadBuildConfig menv mproject config stackRoot mresolver noConfigStrat = do
Nothing -> case noConfigStrat of
ThrowException -> do
currDir <- getWorkingDir
cabalFiles <- findCabalFiles currDir
cabalFiles <- findCabalFiles True currDir
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I just passed in True here, can someone have a look if this might be problematic if init was called with the --ignore-subdirs flag?

Copy link
Contributor

Choose a reason for hiding this comment

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

No, this looks completely correct to me.

snoyberg added a commit that referenced this pull request Jun 27, 2015
Add --ignore-subdirs flag to init command
@snoyberg snoyberg merged commit 7db9424 into commercialhaskell:master Jun 27, 2015
@snoyberg
Copy link
Contributor

Thank you!

snoyberg added a commit that referenced this pull request Jun 27, 2015
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.

None yet

2 participants