From d1375921a7c3b70c0692783a46539ecfbd313194 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 14 Nov 2023 08:37:05 +0200 Subject: Recognize LICENSE.{txt,md}, COPYING as license files --- bdep/new.cxx | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/bdep/new.cxx b/bdep/new.cxx index 4dff04f..b212816 100644 --- a/bdep/new.cxx +++ b/bdep/new.cxx @@ -1322,9 +1322,20 @@ cmd_new (cmd_new_options&& o, cli::group_scanner& args) readme_f = move (f); } - // LICENSE or UNLICENSE + // LICENSE + // LICENSE.txt + // LICENSE.md + // COPYING + // UNLICENSE // - if (exists ((f = out / "LICENSE")) || exists ((f = out / "UNLICENSE"))) + // Note that LICENSE.md is often just a plain text file without any + // markup so we should be able to detect the license. + // + if (exists ((f = out / "LICENSE")) || + exists ((f = out / "LICENSE.txt")) || + exists ((f = out / "LICENSE.md")) || + exists ((f = out / "COPYING")) || + exists ((f = out / "UNLICENSE"))) { license_e = extract_license (f); -- cgit v1.1