Skip to content

Ensure directory exists before searching for a .cabal file #520

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

Merged
merged 2 commits into from
Mar 17, 2015

Conversation

ivan-m
Copy link
Contributor

@ivan-m ivan-m commented Mar 15, 2015

As requested by @gracjan in #506, this makes haskell-cabal-find-file check that the provided directory actually exists before using it to search for a .cabal file.

@gracjan
Copy link
Contributor

gracjan commented Mar 15, 2015

Did you know that you can just force-push new commits to old pull request branch and it will update properly? You do not have to create new pull requests. I find it slightly easier to just push fixed commits.

@ivan-m
Copy link
Contributor Author

ivan-m commented Mar 15, 2015

First time, no; second time, I accidentally deleted the commit and when I tried to force push the new commit it didn't register in the patch request to let me re-open it :s

@gracjan
Copy link
Contributor

gracjan commented Mar 15, 2015

We should put this workflow on some kind of contributing page. It was a mystery for me too.

@gracjan
Copy link
Contributor

gracjan commented Mar 16, 2015

I'd like to test this, how do I trigger the case you are solving here?

@ivan-m
Copy link
Contributor Author

ivan-m commented Mar 17, 2015

(haskell-cabal-find-file "/path/to/nonexistent/directory/")

@ivan-m ivan-m force-pushed the cabal-nonexistent-directories branch from 655aa2b to f1930bd Compare March 17, 2015 05:11
If you have a Cabalised project in an existing directory
"/path/to/project/" and you want to add a new module into an as-yet
nonexistent directory "Foo", you still might want to be able to find the
.cabal file for that project (e.g. to use fields from the .cabal file to
populate a skeleton for the new module).

This patch keeps stripping off directories from the end of the path
until an existing directory is found (or the directory is found to be
nonsensical).
gracjan added a commit that referenced this pull request Mar 17, 2015
Ensure directory exists before searching for a .cabal file
@gracjan gracjan merged commit 651785c into haskell:master Mar 17, 2015
@ivan-m ivan-m deleted the cabal-nonexistent-directories branch March 17, 2015 07:50
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