Skip to content

Commit

Permalink
fix: ignore pattern
Browse files Browse the repository at this point in the history
  • Loading branch information
simoneb committed Dec 29, 2020
1 parent 477d02d commit 5258bad
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/commands/list.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const glob = require('readdir-glob')
const unzipper = require('unzipper')

const { downloadArchive } = require('../api/common')
const { HOST_ROOT } = require('../const')
const { HOST_ROOT, IGNORE_PATTERNS } = require('../const')
const log = require('../log')

async function list({
Expand All @@ -26,7 +26,7 @@ function listLocal(pattern) {
return new Promise((resolve, reject) => {
const globber = glob(HOST_ROOT, {
pattern,
ignore: ['node_modules'],
ignore: IGNORE_PATTERNS,
})

const files = []
Expand Down
2 changes: 2 additions & 0 deletions lib/const.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ const WORKFLOW_LOCAL_PATH = path.join(
const KEY_LENGTH = 24
const IV_LENGTH = 16
const APP_PAGE = `https://github.com/apps/${NAME}`
const IGNORE_PATTERNS = ['node_modules/**']

module.exports = {
NAME,
Expand All @@ -36,6 +37,7 @@ module.exports = {
HOST_ROOT,
KEY_LENGTH,
IV_LENGTH,
IGNORE_PATTERNS,
hostPkg,
ghenvPkg,
}
3 changes: 2 additions & 1 deletion lib/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const {
ENCRIPTION_ALGORITHM,
KEY_LENGTH,
IV_LENGTH,
IGNORE_PATTERNS,
} = require('./const')
const log = require('./log')

Expand Down Expand Up @@ -84,7 +85,7 @@ function createArchive(pattern) {
zip.pipe(concat(resolve))

zip
.glob(pattern, { root: HOST_ROOT, ignore: ['node_modules'] })
.glob(pattern, { root: HOST_ROOT, ignore: IGNORE_PATTERNS })
.finalize()
})
}
Expand Down

0 comments on commit 5258bad

Please sign in to comment.