-
Notifications
You must be signed in to change notification settings - Fork 413
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Error on "dune init" if dir exists named "dune" (#6705)
When running `dune init (exe|lib|test)` in a directory which contains a directory named "dune", prior to this change, the error would be: Error: Is a directory Following this change, the error is now: Error: "/path/to/dune" already exists and is a directory Signed-off-by: Stephen Sherratt <stephen@sherra.tt>
- Loading branch information
Showing
3 changed files
with
30 additions
and
0 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
22 changes: 22 additions & 0 deletions
22
test/blackbox-tests/test-cases/init-error-if-dune-is-directory.t
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,22 @@ | ||
Report an error if `dune init ...` would create a "dune" file in a location | ||
which already has a "dune" directory. | ||
|
||
$ mkdir dune | ||
|
||
$ dune init exe foo | ||
Error: | ||
"$TESTCASE_ROOT/dune" | ||
already exists and is a directory | ||
[1] | ||
|
||
$ dune init lib foo | ||
Error: | ||
"$TESTCASE_ROOT/dune" | ||
already exists and is a directory | ||
[1] | ||
|
||
$ dune init test foo | ||
Error: | ||
"$TESTCASE_ROOT/dune" | ||
already exists and is a directory | ||
[1] |