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: update clear-package-dir to check files array #26645

Merged
merged 1 commit into from
Aug 26, 2020

Conversation

wardpeet
Copy link
Contributor

Description

Fixes clear-package-dir script to honor files array in package.json

@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Aug 26, 2020
@wardpeet wardpeet requested a review from pieh August 26, 2020 12:47
@wardpeet wardpeet added status: needs core review Currently awaiting review from Core team member type: maintenance An issue or pull request describing a change that isn't a bug, feature or documentation change and removed status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer labels Aug 26, 2020
Copy link
Contributor

@pieh pieh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

const pkg = require(`${location}/package.json`)
if (pkg.files && pkg.files.length) {
globPattern =
pkg.files.length > 1 ? `{${pkg.files.join(`,`)}}` : pkg.files[0]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no need to make special case for single element, .join() would work fine as well ;)

but also - let's not change this and then wait for tests to finish again - let's ship the fix

@pieh pieh merged commit 9898b72 into gatsbyjs:master Aug 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: needs core review Currently awaiting review from Core team member type: maintenance An issue or pull request describing a change that isn't a bug, feature or documentation change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants