Skip to content

Pass --dir to @netlify/config #1010

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

Closed
wants to merge 4 commits into from

Conversation

RaeesBhatti
Copy link
Contributor

@RaeesBhatti RaeesBhatti commented Jul 20, 2020

- Summary
Fixes #961

- Test plan

- Description for the changelog

  • Pass --dir flag to @netlify/config
  • Use build.publish instead of --dir flag in netlify deploy and netlify dev

- A picture of a cute animal (not mandatory but encouraged)
🐬

@RaeesBhatti RaeesBhatti requested a review from ehmicky July 20, 2020 15:39
@RaeesBhatti RaeesBhatti marked this pull request as draft July 20, 2020 15:39
@RaeesBhatti RaeesBhatti marked this pull request as ready for review July 20, 2020 15:47
if (flags['dir']) {
deployFolder = path.resolve(process.cwd(), flags['dir'])
} else if (get(config, 'build.publish')) {
if (get(config, 'build.publish')) {
deployFolder = path.resolve(site.root, get(config, 'build.publish'))
} else if (get(siteData, 'build_settings.dir')) {
Copy link
Contributor

Choose a reason for hiding this comment

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

config.build.publish includes siteData.build_settings.dir, so this branch should not be needed anymore.

Copy link
Contributor

@ehmicky ehmicky left a comment

Choose a reason for hiding this comment

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

Should we add several automated tests to cover this change?

To make sure netlify deploy is not using the wrong publish directory, as this would bring down users websites. What do you think?

@erquhart erquhart linked an issue Jul 23, 2020 that may be closed by this pull request
@ehmicky
Copy link
Contributor

ehmicky commented Aug 10, 2020

Closing due to inactivity

@ehmicky ehmicky closed this Aug 10, 2020
@ehmicky ehmicky deleted the raees/pass-dir-flag branch August 10, 2020 16:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Pass the --dir CLI flag to @netlify/config
2 participants