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

Fix #1471 stack commands and file name conflicts #1493

Merged

Conversation

harendra-kumar
Copy link
Collaborator

We were prioritising execution of a file over stack commands if a filename in
the current directory was the same as a stack command. With this fix we first
try a stack command, then an external command stack- and if those fail
we look for a file in the current directory to execute in interpreter mode.

If we intend to execute the file we can specify the path like ./filename.

I had to refactor main to make this work. I tried to minimise the refactoring
and limit the scope to only this fix. Main looks better and modular now.

closes #1471

We were prioritising execution of a file over stack commands if a filename in
the current directory was the same as a stack command. With this fix we first
try a stack command, then an external command stack-<command> and if those fail
we look for a file in the current directory to execute in interpreter mode.

If we intend to execute the file we can specify the path like ./filename.

I had to refactor `main` to make this work. I tried to minimise the refactoring
and limit the scope to only this fix. Main looks better and modular now.

closes commercialhaskell#1471
@mgsloan
Copy link
Contributor

mgsloan commented Dec 12, 2015

LGTM, thanks!!

mgsloan added a commit that referenced this pull request Dec 12, 2015
Fix #1471 stack commands and file name conflicts
@mgsloan mgsloan merged commit 677a8c4 into commercialhaskell:master Dec 12, 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.

Ambiguity between a stack command and a filename to execute
2 participants