about summary refs log tree commit diff
path: root/third_party/nix/src/nix-instantiate/nix-instantiate.cc
diff options
context:
space:
mode:
authorVincent Ambo <tazjin@google.com>2020-05-19T17·01+0100
committerVincent Ambo <tazjin@google.com>2020-05-19T17·01+0100
commit09cbc431cca08be891e5e792ceda2a34956b2fc8 (patch)
tree3653448c7e074bdfd10dfa3bc3b5dfe952299fdf /third_party/nix/src/nix-instantiate/nix-instantiate.cc
parentb490742a511dd03afc43f5143d6d61edaeeb8091 (diff)
fix(3p/nix): Fix incorrectly braced conditionals and loops r/768
Fixes mistakes introduced by clang-tidy in the previous commit.
Diffstat (limited to 'third_party/nix/src/nix-instantiate/nix-instantiate.cc')
-rw-r--r--third_party/nix/src/nix-instantiate/nix-instantiate.cc9
1 files changed, 5 insertions, 4 deletions
diff --git a/third_party/nix/src/nix-instantiate/nix-instantiate.cc b/third_party/nix/src/nix-instantiate/nix-instantiate.cc
index df97f23ef9c9..2630f5f9ebfc 100644
--- a/third_party/nix/src/nix-instantiate/nix-instantiate.cc
+++ b/third_party/nix/src/nix-instantiate/nix-instantiate.cc
@@ -163,7 +163,9 @@ static int _main(int argc, char** argv) {
     if (findFile) {
       for (auto& i : files) {
         Path p = state->findFile(i);
-        if (p == "") throw Error(format("unable to find '%1%'") % i);
+        if (p == "") {
+          throw Error(format("unable to find '%1%'") % i);
+        }
         std::cout << p << std::endl;
       }
       return 0;
@@ -173,10 +175,9 @@ static int _main(int argc, char** argv) {
       Expr* e = state->parseStdin();
       processExpr(*state, attrPaths, parseOnly, strict, autoArgs, evalOnly,
                   outputKind, xmlOutputSourceLocation, e);
-    } else {
-      if
+    } else if (files.empty() && !fromArgs) {
+      files.push_back("./default.nix");
     }
-    (files.empty() && !fromArgs) files.push_back("./default.nix");
 
     for (auto& i : files) {
       Expr* e = fromArgs