Skip to content

Commit 51cd831

Browse files
zrh122haoqunjiang
authored andcommitted
chore: add cwd option when calling globby (#4442)
Make globby working as expected when project path contains parentheses. Close #4417.
1 parent 55e1c3c commit 51cd831

File tree

4 files changed

+4
-6
lines changed

4 files changed

+4
-6
lines changed

packages/@vue/cli-plugin-eslint/lint.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ module.exports = function lint (args = {}, api) {
6161
]
6262
.filter(pattern =>
6363
globby
64-
.sync(path.join(cwd, pattern))
64+
.sync(pattern, { cwd, absolute: true })
6565
.some(p => !engine.isPathIgnored(p))
6666
)
6767

packages/@vue/cli-ui/apollo-server/connectors/locales.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ function reset (context) {
3636
}
3737

3838
function _loadFolder (root, context) {
39-
const paths = globby.sync([path.join(root, './locales/*.json')])
39+
const paths = globby.sync(['./locales/*.json'], { cwd: root, absolute: true })
4040
paths.forEach(file => {
4141
const basename = path.basename(file)
4242
const lang = basename.substr(0, basename.indexOf('.'))

packages/@vue/cli-ui/apollo-server/resolvers.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
const { withFilter } = require('graphql-subscriptions')
2-
const path = require('path')
32
const globby = require('globby')
43
const merge = require('lodash.merge')
54
const { GraphQLJSON } = require('graphql-type-json')
@@ -90,7 +89,7 @@ const resolvers = [{
9089
}]
9190

9291
// Load resolvers in './schema'
93-
const paths = globby.sync([path.join(__dirname, './schema/*.js')])
92+
const paths = globby.sync(['./schema/*.js'], { cwd: __dirname, absolute: true })
9493
paths.forEach(file => {
9594
const { resolvers: r } = require(file)
9695
r && resolvers.push(r)

packages/@vue/cli-ui/apollo-server/type-defs.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
const gql = require('graphql-tag')
2-
const path = require('path')
32
const globby = require('globby')
43

54
const typeDefs = [gql`
@@ -86,7 +85,7 @@ type Subscription {
8685
`]
8786

8887
// Load types in './schema'
89-
const paths = globby.sync([path.join(__dirname, './schema/*.js')])
88+
const paths = globby.sync(['./schema/*.js'], { cwd: __dirname, absolute: true })
9089
paths.forEach(file => {
9190
const { types } = require(file)
9291
types && typeDefs.push(types)

0 commit comments

Comments
 (0)