aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorPriyansh <[email protected]>2021-03-07 20:26:24 +0530
committerPriyansh <[email protected]>2021-03-07 20:26:24 +0530
commit4f0df15d51ffa017155d515940e85acc710958e4 (patch)
treef80616327bdbbb7853689c4ff9616d4c2fede46b /bin
parent1c2e74850b073b5963e7d10081e3c893f0eb6a9b (diff)
downloadcalculator-main.tar.xz
calculator-main.zip
Added Licence OptionHEADmain
Diffstat (limited to 'bin')
-rw-r--r--bin/index.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/bin/index.js b/bin/index.js
index 6d87d1d..b2a3f36 100644
--- a/bin/index.js
+++ b/bin/index.js
@@ -6,6 +6,8 @@ const boxen = require("boxen");
const chalk = require("chalk");
const packageInfo = require('./../package.json');
const math = require('mathjs');
+const fs = require('fs');
+const path = require('path');
const infoMessage = {
getIntroductoryMessage: () => {
// If the command is run without any options we will show the about screen
@@ -82,3 +84,9 @@ Command Help Example:
if (args.info || Object.keys(args).length < 3 && !args._.length) {
infoMessage.getIntroductoryMessage();
}
+
+if (args.license && Object.keys(args).length === 3 && !args._.length) {
+ const filePath = path.join(__dirname, '../LICENSE');
+ const licenseContents = fs.readFileSync(filePath);
+ console.log(licenseContents.toString());
+}