Skip to content
This repository has been archived by the owner on Feb 5, 2022. It is now read-only.

Commit

Permalink
fix: do not transform binary path
Browse files Browse the repository at this point in the history
fix #112
  • Loading branch information
egoist committed Nov 20, 2018
1 parent e944eb6 commit 6240ad1
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/runActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ const path = require('path')
const majo = require('majo')
const matcher = require('micromatch')
const { glob, fs } = require('majo')
const isBinaryPath = require('is-binary-path')
const logger = require('./logger')
const getGlobPatterns = require('./utils/getGlobPatterns')

Expand Down Expand Up @@ -47,6 +48,9 @@ module.exports = async (config, context) => {
stream.use(({ files }) => {
let fileList = Object.keys(stream.files)

// Exclude binary path
fileList = fileList.filter(fp => !isBinaryPath(fp))

if (action.transformInclude) {
fileList = matcher(fileList, action.transformInclude)
}
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"hash-sum": "^1.0.2",
"ini": "^1.3.5",
"inquirer": "^6.2.0",
"is-binary-path": "^2.0.0",
"joycon": "^2.1.2",
"jstransformer": "^1.0.0",
"jstransformer-ejs": "^0.2.0",
Expand Down
7 changes: 7 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3805,6 +3805,13 @@ is-binary-path@^1.0.0:
dependencies:
binary-extensions "^1.0.0"

is-binary-path@^2.0.0:
version "2.0.0"
resolved "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.0.0.tgz#0e61cea6974b24dda8bcc8366ce58a69265d1a36"
integrity sha1-DmHOppdLJN2ovMg2bOWKaSZdGjY=
dependencies:
binary-extensions "^1.0.0"

is-buffer@^1.1.4, is-buffer@^1.1.5:
version "1.1.6"
resolved "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be"
Expand Down

0 comments on commit 6240ad1

Please sign in to comment.