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

Projects
None yet
2 participants
@markus1189
Contributor

markus1189 commented Jun 27, 2015

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

This comment has been minimized.

@markus1189

markus1189 Jun 27, 2015

Contributor

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?

This comment has been minimized.

@snoyberg

snoyberg Jun 27, 2015

Contributor

No, this looks completely correct to me.

snoyberg added a commit that referenced this pull request Jun 27, 2015

Merge pull request #435 from markus1189/init-ignore-subdirs
Add --ignore-subdirs flag to init command

@snoyberg snoyberg merged commit 7db9424 into commercialhaskell:master Jun 27, 2015

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@snoyberg

This comment has been minimized.

Contributor

snoyberg commented Jun 27, 2015

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