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

Commit 6240ad1

Browse files
committed
fix: do not transform binary path
fix #112
1 parent e944eb6 commit 6240ad1

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

lib/runActions.js

+4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ const path = require('path')
22
const majo = require('majo')
33
const matcher = require('micromatch')
44
const { glob, fs } = require('majo')
5+
const isBinaryPath = require('is-binary-path')
56
const logger = require('./logger')
67
const getGlobPatterns = require('./utils/getGlobPatterns')
78

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

51+
// Exclude binary path
52+
fileList = fileList.filter(fp => !isBinaryPath(fp))
53+
5054
if (action.transformInclude) {
5155
fileList = matcher(fileList, action.transformInclude)
5256
}

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
"hash-sum": "^1.0.2",
3030
"ini": "^1.3.5",
3131
"inquirer": "^6.2.0",
32+
"is-binary-path": "^2.0.0",
3233
"joycon": "^2.1.2",
3334
"jstransformer": "^1.0.0",
3435
"jstransformer-ejs": "^0.2.0",

yarn.lock

+7
Original file line numberDiff line numberDiff line change
@@ -3805,6 +3805,13 @@ is-binary-path@^1.0.0:
38053805
dependencies:
38063806
binary-extensions "^1.0.0"
38073807

3808+
is-binary-path@^2.0.0:
3809+
version "2.0.0"
3810+
resolved "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.0.0.tgz#0e61cea6974b24dda8bcc8366ce58a69265d1a36"
3811+
integrity sha1-DmHOppdLJN2ovMg2bOWKaSZdGjY=
3812+
dependencies:
3813+
binary-extensions "^1.0.0"
3814+
38083815
is-buffer@^1.1.4, is-buffer@^1.1.5:
38093816
version "1.1.6"
38103817
resolved "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be"

0 commit comments

Comments
 (0)