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

Pass site or siteId to @netlify/config #1008

Merged
merged 2 commits into from
Jul 20, 2020
Merged
Changes from 1 commit
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
6 changes: 3 additions & 3 deletions src/utils/command.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class BaseCommand extends Command {
// Get site id & build state
const state = new StateConfig(cwd)

const cachedConfig = await this.getConfig(cwd, state, token)
const cachedConfig = await this.getConfig(cwd, state, token, argv)
const { configPath, config, buildDir } = cachedConfig

const apiOpts = {}
Expand Down Expand Up @@ -69,14 +69,14 @@ class BaseCommand extends Command {
}

// Find and resolve the Netlify configuration
async getConfig(cwd, state, token) {
async getConfig(cwd, state, token, argv) {
try {
return await resolveConfig({
config: argv.config,
cwd: cwd,
context: argv.context,
debug: argv.debug,
siteId: state.get('siteId'),
siteId: argv.siteId || typeof argv.site === 'string' && argv.site || state.get('siteId'),
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we have any CLI flag called siteId instead of site?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, we have a site flag in netlify deploy

Copy link
Contributor

@ehmicky ehmicky Jul 20, 2020

Choose a reason for hiding this comment

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

We have a site CLI flag in other commands as well. What about a siteId CLI flag?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The other site flag is a boolean. That's why I'm checking for typeof. We're checking for both siteId and a string site flag now.

Copy link
Contributor

Choose a reason for hiding this comment

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

I am wondering if argv.siteId || could be removed since we don't have any siteId CLI flag at the moment?

token,
mode: 'cli',
})
Expand Down