Skip to content

Commit

Permalink
fix: match files from project root
Browse files Browse the repository at this point in the history
  • Loading branch information
varl committed Apr 7, 2021
1 parent 4d858db commit b77ef35
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/utils/files.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const path = require('path')
const log = require('@dhis2/cli-helpers-engine').reporter
const fg = require('fast-glob')
const fs = require('fs-extra')
const { CONSUMING_ROOT, PACKAGE_ROOT } = require('./paths.js')
const { CONSUMING_ROOT, PROJECT_ROOT } = require('./paths.js')
const { spawn } = require('./run.js')

// blacklists for files
Expand Down Expand Up @@ -150,9 +150,12 @@ function selectFiles(files, pattern, staged) {
dot: true,
ignore: blacklist.map(b => `**/${b}/**`),
absolute: true,
cwd: PACKAGE_ROOT,
cwd: PROJECT_ROOT,
})

log.debug(`Using pattern: ${pattern}`)
log.debug(`Matched files: ${codeFiles.join(', ')}`)

if (files.length > 0) {
codeFiles = files
.filter(f => codeFiles.includes(path.resolve(f)))
Expand Down

0 comments on commit b77ef35

Please sign in to comment.