Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add cwd option when calling globby #4442

Merged
merged 1 commit into from
Aug 21, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
chore: add cwd option when calling globby
make globby working as expected when project path contains parentheses
  • Loading branch information
zrh122 committed Aug 15, 2019
commit 4503f5fe553f618db837b9a3fdd54c8196eb9bab
2 changes: 1 addition & 1 deletion packages/@vue/cli-plugin-eslint/lint.js
Original file line number Diff line number Diff line change
Expand Up @@ -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))
)

Expand Down
2 changes: 1 addition & 1 deletion packages/@vue/cli-ui/apollo-server/connectors/locales.js
Original file line number Diff line number Diff line change
Expand Up @@ -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('.'))
Expand Down
3 changes: 1 addition & 2 deletions packages/@vue/cli-ui/apollo-server/resolvers.js
Original file line number Diff line number Diff line change
@@ -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')
Expand Down Expand Up @@ -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)
Expand Down
3 changes: 1 addition & 2 deletions packages/@vue/cli-ui/apollo-server/type-defs.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
const gql = require('graphql-tag')
const path = require('path')
const globby = require('globby')

const typeDefs = [gql`
Expand Down Expand Up @@ -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)
Expand Down