Skip to content

Commit 2a14d23

Browse files
committed
feat: add support for --canonical to validate
- add support for --canonical to validate - add test for non-resolved support info to validate Signed-off-by: Michael Dawson <[email protected]>
1 parent 0dbbffa commit 2a14d23

File tree

4 files changed

+13
-2
lines changed

4 files changed

+13
-2
lines changed

lib/cli/commands/validate.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ module.exports = function (opts) {
2525

2626
let supportData = userPackageJson.support
2727
if (supportData === true) {
28-
supportData = support.getSupportData(userPackageJson, path.join(process.cwd()), false, undefined)
28+
supportData = support.getSupportData(userPackageJson, path.join(process.cwd()), argv.canonical, argv['base-path'])
2929
if (supportData.resolved) {
3030
const supportDataJSON = JSON.parse(supportData.contents)
3131
try {
@@ -38,7 +38,7 @@ module.exports = function (opts) {
3838
argv.log.error('validate: ', e.validationErrors)
3939
}
4040
} else {
41-
argv.log.info('support info not resolved:' + supportData.url)
41+
argv.log.info('support info not resolved: ' + supportData.url)
4242
}
4343
} else {
4444
argv.log.info('no support info')
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
validate --canonical
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
info › support info not resolved: https://github.com/pkgjs/support/blob/master/package-support.json
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"name": "@pkgjs/support-show-local",
3+
"version": "0.0.1",
4+
"support": true,
5+
"repository": {
6+
"type": "git",
7+
"url": "https://github.com/pkgjs/support.git"
8+
}
9+
}

0 commit comments

Comments
 (0)