From 5e4d4832f6d6cc5ebd7fd9e7282a151cc1257b4d Mon Sep 17 00:00:00 2001 From: accraze Date: Wed, 2 Mar 2016 17:34:15 -0800 Subject: [PATCH] feat(licenses): added bsd 3-clause license source: http://opensource.org/licenses/BSD-3-Clause --- src/index.js | 2 +- src/licenses/bsd3.js | 26 ++++++++++++++++++++++++++ src/make-license.js | 10 ++++++++++ 3 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 src/licenses/bsd3.js diff --git a/src/index.js b/src/index.js index 297c8bb..dbae111 100755 --- a/src/index.js +++ b/src/index.js @@ -11,7 +11,7 @@ var questions = [ type: "list", name: "license", message: "Choose a License", - choices: [ "MIT", "ISC", "UNLICENSE", "NO LICENSE" ] + choices: [ "MIT", "ISC", "BSD 3", "UNLICENSE", "NO LICENSE" ] } ]; diff --git a/src/licenses/bsd3.js b/src/licenses/bsd3.js new file mode 100644 index 0000000..3972227 --- /dev/null +++ b/src/licenses/bsd3.js @@ -0,0 +1,26 @@ + + +var bsd3 = "\nAll rights reserved.\n\n"+ +"Redistribution and use in source and binary forms, with or without\n" + +"modification, are permitted provided that the following conditions are met:\n\n" + +"* Redistributions of source code must retain the above copyright notice, this\n" + +" list of conditions and the following disclaimer.\n\n" + +"* Redistributions in binary form must reproduce the above copyright notice,\n" + +" this list of conditions and the following disclaimer in the documentation\n" + +" and/or other materials provided with the distribution.\n\n" + +"* Neither the name of copyright holder nor the names of its\n" + +" contributors may be used to endorse or promote products derived from\n" + +" this software without specific prior written permission.\n\n" + +"THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n" + +"AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n" + +"IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n" + +"DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\n" + +"FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n" + +"DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n" + +"SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n" + +"CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\n"+ +"OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n"+ +"OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"; + + +module.exports = bsd3; diff --git a/src/make-license.js b/src/make-license.js index efdc092..751613a 100644 --- a/src/make-license.js +++ b/src/make-license.js @@ -2,6 +2,7 @@ var fs = require('fs'); var inquirer = require("inquirer"); var mit = require("./licenses/mit") var isc = require("./licenses/isc") +var bsd3 = require("./licenses/bsd3") var unlicense = require("./licenses/unlicense") module.exports = makeLicense @@ -26,6 +27,15 @@ function makeLicense (args) { print(license); }); } + else if (args.license === 'BSD 3'){ + var questions = copyrightQuestions(); + inquirer.prompt(questions, function(answers){ + var license = "Copyright (c) " + license += answers.years + ", " + answers.name; + license += bsd3; + print(license); + }); + } else if (args.license === 'NO LICENSE'){ var questions = copyrightQuestions(); inquirer.prompt(questions, function(answers){