Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Ambiguity between a stack command and a filename to execute #1471
Separating this from issue #1394
If we have a file in the current directory whose name matches any of the stack commands then instead of running the command stack will execute the file as an interpreter. Here is an example:
Currently we look at the argument and if it is a file and contains a valid stack comment we execute it. There is an ambiguity here about whether build should be treated as a command or a file.
A couple of ways to handle this:
An easy fix is to give preference to commands i.e. reserve the syntax
shebang case works fine with this solution. Consider executing a file named
We can distinguish the case by using a subcommand e.g. use
So the alternative is to use a distinct stack binary name let's say
Any other ideas?