aboutsummaryrefslogtreecommitdiff
path: root/src/nix/flake.cc
diff options
context:
space:
mode:
authorTaeer Bar-Yam <taeer@bar-yam.me>2022-02-15 11:50:14 -0500
committerTaeer Bar-Yam <taeer@bar-yam.me>2022-02-15 11:50:14 -0500
commitf3a2940e70dea2c35dcae3fca019e94bf8758b4d (patch)
tree2146a8fb3ff60d4c6580e5a6a4687dd84b7013d5 /src/nix/flake.cc
parent5b809f9e0e0fe84304c2ae0f5f7b2d4db02565ad (diff)
add descriptive output when creating templates
this includes a `welcomeText` attribute which can be set in the template, as well as outputing which files were created.
Diffstat (limited to 'src/nix/flake.cc')
-rw-r--r--src/nix/flake.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/nix/flake.cc b/src/nix/flake.cc
index 4bc79820c..f5d34c10f 100644
--- a/src/nix/flake.cc
+++ b/src/nix/flake.cc
@@ -728,6 +728,7 @@ struct CmdFlakeInitCommon : virtual Args, EvalCommand
else
throw Error("file '%s' has unsupported type", from2);
files.push_back(to2);
+ notice("wrote: %s", to2);
}
};
@@ -738,6 +739,11 @@ struct CmdFlakeInitCommon : virtual Args, EvalCommand
for (auto & s : files) args.push_back(s);
runProgram("git", true, args);
}
+ auto welcomeText = cursor->maybeGetAttr("welcomeText");
+ if (welcomeText) {
+ notice("\n----------\n");
+ notice(welcomeText->getString());
+ }
}
};