mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-15 02:36:16 +02:00
fix(nix/eval.cc): move call to fs::create_directory
out of assert
If the call is inside the assertion, then in non-assert builds the call would be stripped out. This is highly unexpected.
This commit is contained in:
parent
694c378d14
commit
8277b50b6f
1 changed files with 2 additions and 1 deletions
|
@ -89,8 +89,9 @@ struct CmdEval : MixJSON, InstallableValueCommand, MixReadOnlyOption
|
||||||
// FIXME: disallow strings with contexts?
|
// FIXME: disallow strings with contexts?
|
||||||
writeFile(path.string(), v.string_view());
|
writeFile(path.string(), v.string_view());
|
||||||
else if (v.type() == nAttrs) {
|
else if (v.type() == nAttrs) {
|
||||||
|
[[maybe_unused]] bool directoryCreated = fs::create_directory(path);
|
||||||
// Directory should not already exist
|
// Directory should not already exist
|
||||||
assert(fs::create_directory(path.string()));
|
assert(directoryCreated);
|
||||||
for (auto & attr : *v.attrs()) {
|
for (auto & attr : *v.attrs()) {
|
||||||
std::string_view name = state->symbols[attr.name];
|
std::string_view name = state->symbols[attr.name];
|
||||||
try {
|
try {
|
||||||
|
|
Loading…
Reference in a new issue