Skip to content

feat: disable auto-upgrade based on environment variable#113

Merged
JohnPhamous merged 1 commit into
mainfrom
johnphamous/product-251-add-cli-flag-to-disable-auto-updates
Apr 11, 2025
Merged

feat: disable auto-upgrade based on environment variable#113
JohnPhamous merged 1 commit into
mainfrom
johnphamous/product-251-add-cli-flag-to-disable-auto-updates

Conversation

@JohnPhamous
Copy link
Copy Markdown
Contributor

Added a check to skip the auto-upgrade process if the environment variable SF_CLI_DISABLE_AUTO_UPGRADE is set. This allows users to control the upgrade behavior of the CLI more effectively.

Added a check to skip the auto-upgrade process if the environment variable SF_CLI_DISABLE_AUTO_UPGRADE is set. This allows users to control the upgrade behavior of the CLI more effectively.
@semanticdiff-com
Copy link
Copy Markdown

semanticdiff-com Bot commented Apr 11, 2025

Review changes with  SemanticDiff

Changed Files
File Status
  src/checkVersion.ts  0% smaller

@JohnPhamous JohnPhamous merged commit 0d25447 into main Apr 11, 2025
1 check passed
Copy link
Copy Markdown
Contributor

@greptile-apps greptile-apps Bot left a comment

Choose a reason for hiding this comment

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

PR Summary

This PR adds the ability to disable automatic CLI upgrades by checking for the SF_CLI_DISABLE_AUTO_UPGRADE environment variable in the version checking logic.

  • Added an early return in src/checkVersion.ts that skips version checking when the environment variable is set
  • This feature is particularly useful for CI/CD pipelines and automated environments where unexpected upgrades could be disruptive
  • Maintains backward compatibility as the environment variable is opt-in
  • Aligns with existing versioning infrastructure documented in the README's "New Release" section
  • Implementation is minimal and focused, only affecting the version checking logic without modifying other CLI behaviors

Greptile AI

1 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings | Greptile

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.

1 participant