aboutsummaryrefslogtreecommitdiff
path: root/bdep/new.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2018-07-02 11:24:47 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2018-07-02 11:24:47 +0200
commit93a673946ca1587126b3c108476234d93a7c5c7c (patch)
tree531c8e10c1d5bdf780012e207facae6c31857f91 /bdep/new.cxx
parent85fe1442232cc747ce4935708ecefba00ab7c101 (diff)
Try to obtain real email from environment, VCS in bdep-new
Diffstat (limited to 'bdep/new.cxx')
-rw-r--r--bdep/new.cxx12
1 files changed, 10 insertions, 2 deletions
diff --git a/bdep/new.cxx b/bdep/new.cxx
index ab8b255..9869fe7 100644
--- a/bdep/new.cxx
+++ b/bdep/new.cxx
@@ -5,6 +5,7 @@
#include <bdep/new.hxx>
#include <bdep/project.hxx>
+#include <bdep/project-email.hxx>
#include <bdep/database.hxx>
#include <bdep/diagnostics.hxx>
@@ -172,7 +173,8 @@ namespace bdep
fail << "directory " << out << " already exists";
// Initialize the version control system. Do it before writing anything
- // ourselves in case it fails.
+ // ourselves in case it fails. Also, the email discovery may do the VCS
+ // detection.
//
if (!pkg)
{
@@ -257,6 +259,12 @@ namespace bdep
// manifest
//
+ string email;
+ {
+ optional<string> r (project_email (prj));
+ email = r ? move (*r) : "you@example.org";
+ }
+
os.open (f = out / "manifest");
os << ": 1" << endl
<< "name: " << n << endl
@@ -264,7 +272,7 @@ namespace bdep
<< "summary: " << s << " " << t << endl
<< "license: TODO" << endl
<< "url: https://example.org/" << n << endl
- << "email: you@example.org" << endl
+ << "email: " << email << endl
<< "depends: * build2 >= 0.8.0-" << endl
<< "depends: * bpkg >= 0.8.0-" << endl
<< "#depends: libhello ^1.0.0" << endl;