Skip to content

Commit

Permalink
fix(deps): support for yargs>=17.1.0. (#129)
Browse files Browse the repository at this point in the history
* Revert "fix: revert yargs for now."

This reverts commit c17c8b0.

* fix(deps): support for yargs>=17.1.0.
  • Loading branch information
neverendingqs committed Oct 6, 2021
1 parent 98b123f commit df7b63a
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 10 deletions.
19 changes: 13 additions & 6 deletions bin/d2l-license-checker
Expand Up @@ -16,10 +16,17 @@ const OverrideHelper = require('../lib/override-helper');

const defaultConfigFilePath = '.licensechecker.json';
const argv = require('yargs')
.usage(
'$0 [project-path [config-file-path]]\n\n' +
' If no project path is given, the current directory with be used\n' +
` If no config path is given, the file <project-path>/${defaultConfigFilePath} will be used as default.`)
.usage('$0 [project-path] [config-file-path]', '', yargs => {
yargs
.positional('project-path', {
describe: 'Path to the project from current directory.',
defaultDescription: 'current directory.'
})
.positional('config-file-path', {
describe: 'Path to configuration file from current directory.',
defaultDescription: `<project-path>/${defaultConfigFilePath}`
})
})
.help('h')
.alias('h', 'help')
.alias('t', 'generate-template')
Expand All @@ -32,8 +39,8 @@ const argv = require('yargs')
.boolean(['d', 'p', 't'])
.strict()
.argv;
const projectDir = argv._[0] || process.cwd();
const configFilePath = path.resolve(argv._[1] || path.join(projectDir, defaultConfigFilePath));
const projectDir = argv.projectPath || process.cwd();
const configFilePath = path.resolve(argv.configFilePath || path.join(projectDir, defaultConfigFilePath));
const configAcceptedEntries = ['manualOverrides', 'acceptedScopes', 'ignoreUnusedManualOverrides'];
const spdxExceptions = ['Public-Domain', 'Project-Owner'];
const specialExemptionPrefix = 'D2L-Open-Source-Special-Exemption';
Expand Down
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -23,7 +23,7 @@
"semver": "^7.3.5",
"spdx-license-ids": "^3.0.10",
"spdx-satisfies": "^5.0.1",
"yargs": "17.0.1"
"yargs": "^17.2.1"
},
"devDependencies": {
"chai": "^4.3.4",
Expand Down

0 comments on commit df7b63a

Please sign in to comment.