Skip to content

Commit

Permalink
fix(deps): support for yargs>=17.1.0.
Browse files Browse the repository at this point in the history
  • Loading branch information
neverendingqs committed Oct 6, 2021
1 parent 939ade7 commit 796862c
Showing 1 changed file with 13 additions and 6 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

0 comments on commit 796862c

Please sign in to comment.