mirror of
https://github.com/vuejs/vue-cli.git
synced 2026-05-03 10:32:10 -05:00
chore: add cwd option when calling globby (#4442)
Make globby working as expected when project path contains parentheses. Close #4417.
This commit is contained in:
@@ -61,7 +61,7 @@ module.exports = function lint (args = {}, api) {
|
||||
]
|
||||
.filter(pattern =>
|
||||
globby
|
||||
.sync(path.join(cwd, pattern))
|
||||
.sync(pattern, { cwd, absolute: true })
|
||||
.some(p => !engine.isPathIgnored(p))
|
||||
)
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ function reset (context) {
|
||||
}
|
||||
|
||||
function _loadFolder (root, context) {
|
||||
const paths = globby.sync([path.join(root, './locales/*.json')])
|
||||
const paths = globby.sync(['./locales/*.json'], { cwd: root, absolute: true })
|
||||
paths.forEach(file => {
|
||||
const basename = path.basename(file)
|
||||
const lang = basename.substr(0, basename.indexOf('.'))
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
const { withFilter } = require('graphql-subscriptions')
|
||||
const path = require('path')
|
||||
const globby = require('globby')
|
||||
const merge = require('lodash.merge')
|
||||
const { GraphQLJSON } = require('graphql-type-json')
|
||||
@@ -90,7 +89,7 @@ const resolvers = [{
|
||||
}]
|
||||
|
||||
// Load resolvers in './schema'
|
||||
const paths = globby.sync([path.join(__dirname, './schema/*.js')])
|
||||
const paths = globby.sync(['./schema/*.js'], { cwd: __dirname, absolute: true })
|
||||
paths.forEach(file => {
|
||||
const { resolvers: r } = require(file)
|
||||
r && resolvers.push(r)
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
const gql = require('graphql-tag')
|
||||
const path = require('path')
|
||||
const globby = require('globby')
|
||||
|
||||
const typeDefs = [gql`
|
||||
@@ -86,7 +85,7 @@ type Subscription {
|
||||
`]
|
||||
|
||||
// Load types in './schema'
|
||||
const paths = globby.sync([path.join(__dirname, './schema/*.js')])
|
||||
const paths = globby.sync(['./schema/*.js'], { cwd: __dirname, absolute: true })
|
||||
paths.forEach(file => {
|
||||
const { types } = require(file)
|
||||
types && typeDefs.push(types)
|
||||
|
||||
Reference in New Issue
Block a user