-
Notifications
You must be signed in to change notification settings - Fork 365
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
feat: allow frameworks to detect version of CLI that's being used #6226
Changes from all commits
5da2b2e
97a1402
ba81854
3f720b7
fe9278e
e009bee
6ef1cd8
b0576c2
1554fde
1b70e94
283c000
db10c9a
c56483e
4dbe518
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,6 +26,7 @@ import { | |
exit, | ||
getToken, | ||
log, | ||
netlifyCliVersion, | ||
normalizeConfig, | ||
padLeft, | ||
pollForToken, | ||
|
@@ -546,7 +547,8 @@ export default class BaseCommand extends Command { | |
token, | ||
...apiUrlOpts, | ||
}) | ||
const { buildDir, config, configPath, repositoryRoot, siteInfo } = cachedConfig | ||
const { buildDir, config, configPath, env, repositoryRoot, siteInfo } = cachedConfig | ||
env.NETLIFY_CLI_VERSION = { sources: ['internal'], value: netlifyCliVersion } | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is the main functional change in this PR. I don't have strong feelings around the name of the var - maybe There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this var name is just fine - clear is best imo (even if it's wordy :D ) |
||
const normalizedConfig = normalizeConfig(config) | ||
const agent = await getAgent({ | ||
httpProxy: flags.httpProxy, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -61,8 +61,10 @@ export const envList = async (options: OptionValues, command: BaseCommand) => { | |
|
||
// filter out general sources | ||
environment = Object.fromEntries( | ||
// @ts-expect-error TS(2571) FIXME: Object is of type 'unknown'. | ||
Object.entries(environment).filter(([, variable]) => variable.sources[0] !== 'general'), | ||
Object.entries(environment).filter( | ||
// @ts-expect-error TS(2571) FIXME: Object is of type 'unknown'. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What would it take to get rid of this? |
||
([, variable]) => variable.sources[0] !== 'general' && variable.sources[0] !== 'internal', | ||
), | ||
) | ||
|
||
// Return json response for piping commands | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: This name feels a bit redundant and overly verbose to me, since everything here pertains to the Netlify CLI and there's no need to make that explicit with a prefix. Could we use something like
version
?