forked from purescript/purescript
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for
--source-globs-file
CLI arg in relevant purs
comm…
…ands (purescript#4530) * Enable passing source input globs via `--source-globs-file path/to/file` `--source-globs-file` support has been added to the following commands: `compile`, `docs`, `graph`, `ide`, and `publish`. Due to a [shell character limitation on Windows](https://learn.microsoft.com/en-us/troubleshoot/windows-client/shell-experience/command-line-string-limitation) where a large list of source globs cannot be passed (e.g. `purs compile ... glob1000/src/**/*.purs`), source globs can be stored in a file according to the format below and the file is passed in instead via `purs compile ---source-globs-file path/to/file`. ``` # Lines starting with '#' are comments. # Blank lines are ignored. # Otherwise, every line is a glob. .spago/foo-1.2.3/src/**/*.purs .spago/bar-2.3.3/src/**/*.purs my-package/src/**/*.purs my-package/tests/**/*.purs ``` `--source-globs-file` is an optional argument. Mixing it with the normal source globs is fine. Assuming `.spago/source-globs` contains `src/**/*.purs`, each command below will use the same input globs: ```sh purs compile src/**/*.purs purs compile --source-globs .spago/source-globs purs compile --source-globs .spago/source-globs src/**/*.purs ``` In the command... ``` purs compile inputGlob1 inputGlob2 --source-globs-file fileWithMoreGlobs --exclude-files excludeGlob1 ``` the files passed to the compiler are: all the files found by `inputGlob1`, `inputGlob2`, and all the globs listed in `fileWithMoreGlobs` minus the files found by `excludeGlob1`. * Add `--exclude-file` to more commands While implementing the fix above, I discovered that the `--exclude-file` CLI arg wasn't included in other `purs` commands where such a usage would be relevant (e.g. `docs`, `repl`, `graph`, and `ide`). This PR also rectifies that problem.
- Loading branch information
1 parent
e25c476
commit 5dcd000
Showing
15 changed files
with
317 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
* Add `--exclude-file` to more commands | ||
|
||
This CLI arg was added to the `compile` command, but not to other commands | ||
where such a usage would be relevant (e.g. `docs`, `repl`, `graph`, and `ide`). | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
* Enable passing source input globs via `--source-globs-file path/to/file` | ||
|
||
`--source-globs-file` support has been added to the following commands: | ||
`compile`, `docs`, `graph`, `ide`, and `publish`. | ||
|
||
Due to a [shell character limitation on Windows](https://learn.microsoft.com/en-us/troubleshoot/windows-client/shell-experience/command-line-string-limitation) where a large list of | ||
source globs cannot be passed (e.g. `purs compile ... glob1000/src/**/*.purs`), | ||
source globs can be stored in a file according to the format below | ||
and the file is passed in instead via `purs compile ---source-globs-file path/to/file`. | ||
|
||
``` | ||
# Lines starting with '#' are comments. | ||
# Blank lines are ignored. | ||
# Otherwise, every line is a glob. | ||
.spago/foo-1.2.3/src/**/*.purs | ||
.spago/bar-2.3.3/src/**/*.purs | ||
my-package/src/**/*.purs | ||
my-package/tests/**/*.purs | ||
``` | ||
|
||
`--source-globs-file` is an optional argument. Mixing it with the normal source globs is fine. | ||
Assuming `.spago/source-globs` contains `src/**/*.purs`, each command below will use | ||
the same input globs: | ||
```sh | ||
purs compile src/**/*.purs | ||
purs compile --source-globs .spago/source-globs | ||
purs compile --source-globs .spago/source-globs src/**/*.purs | ||
``` | ||
|
||
In the command... | ||
``` | ||
purs compile inputGlob1 inputGlob2 --source-globs-file fileWithMoreGlobs --exclude-files excludeGlob1 | ||
``` | ||
the files passed to the compiler are: all the files found by | ||
`inputGlob1`, `inputGlob2`, and all the globs listed in `fileWithMoreGlobs` | ||
minus the files found by `excludeGlob1`. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.