Skip to content

Commit

Permalink
fix: glob always expecting path to be provided
Browse files Browse the repository at this point in the history
  • Loading branch information
lirantal committed Aug 28, 2023
1 parent 792b22e commit a45ff60
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions packages/lockfile-lint/bin/lockfile-lint.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,10 @@ const supportedValidators = new Map([
['validate-integrity', 'validateIntegrity']
])

const lockfilesList = glob.sync(config.path)
let lockfilesList = []
if (config.path) {
lockfilesList = glob.sync(config.path)
}

for (const lockfilePath of lockfilesList) {
if (lockfilesList.length > 1) {
Expand Down Expand Up @@ -113,38 +116,38 @@ for (const lockfilePath of lockfilesList) {
}
}

function success(message) {
function success (message) {
const m = [
isPrettyFormat ? GREEN : '',
isPrettyFormat ? symbols.success : '',
message,
'\n',
isPrettyFormat ? RESET : ''
].filter((e) => !!e)
].filter(e => !!e)

console.info(m.join(' '))
}

function warn(message) {
function warn (message) {
const m = [
isPrettyFormat ? YELLOW : '',
isPrettyFormat ? symbols.info : '',
message,
'\n',
isPrettyFormat ? RESET : ''
].filter((e) => !!e)
].filter(e => !!e)

console.error(m.join(' '))
}

function error(message) {
function error (message) {
const m = [
isPrettyFormat ? RED : '',
isPrettyFormat ? symbols.error : '',
message,
'\n',
isPrettyFormat ? RESET : ''
].filter((e) => !!e)
].filter(e => !!e)

console.error(m.join(' '))
}

0 comments on commit a45ff60

Please sign in to comment.