diff options
Diffstat (limited to 'bin/index.js')
| -rw-r--r-- | bin/index.js | 8 |
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()); +} |
