diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2020-01-24 13:01:07 +0100 |
---|---|---|
committer | Eelco Dolstra <edolstra@gmail.com> | 2020-01-24 13:01:34 +0100 |
commit | cd973fa07f4939b6f21b7254c795e347d31fce74 (patch) | |
tree | 9ff913faaed6ef55e30cbfb1788aef88be0fb25e | |
parent | b430a81a1fbf6c792ba49e3aefe46256263430e5 (diff) |
Give a better error message when a flake path is not a directory
-rw-r--r-- | src/libexpr/flake/flakeref.cc | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/libexpr/flake/flakeref.cc b/src/libexpr/flake/flakeref.cc index 397b1b84b..3ebaada15 100644 --- a/src/libexpr/flake/flakeref.cc +++ b/src/libexpr/flake/flakeref.cc @@ -111,6 +111,9 @@ std::pair<FlakeRef, std::string> parseFlakeRefWithFragment( throw BadURL("flake reference '%s' is not an absolute path", url); path = absPath(path, baseDir, true); + if (!S_ISDIR(lstat(path).st_mode)) + throw BadURL("path '%s' is not a flake (because it's not a directory)", path); + auto flakeRoot = path; std::string subdir; |