Skip to content

[shellenv] filter out DEVBOX_LATEST_VERSION env var #1331

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

Merged
merged 1 commit into from
Jul 28, 2023

Conversation

savil
Copy link
Collaborator

@savil savil commented Jul 28, 2023

Summary

The Devbox launcher invokes the Devbox binary with DEVBOX_LATEST_VERSION env-var
being set. The Devbox binary uses this env-var to determine if a new version is
available, and if it needs to alert the user to update.

This env-var was never intended to be "exported" to the rest of the environment.
However, devbox shellenv was doing so.

This becomes problematic if a user does eval $(devbox global shellenv) in
their shellrc file, and has done devbox global add coreutils. Then, doing ls
or cat <file>, or using any of the coreutils programs seems to trigger
an avalanche of "new Devbox available" notices.

Fix:
this PR filters out DEVBOX_LATEST_VERSION from the environment that shellenv
exports.

How was it tested?

> export DEVBOX_LATEST_VERSION=0.5.12

# verify it was being exported
> devbox shellenv | grep "DEVBOX_LATEST"
DEVBOX_LATEST_VERSION=0.5.12

> devbox run build

# no longer present
> devbox shellenv | grep "DEVBOX_LATEST"

Copy link
Collaborator Author

savil commented Jul 28, 2023

Current dependencies on/for this PR:

This comment was auto-generated by Graphite.

@savil savil requested a review from mikeland73 July 28, 2023 23:30
Copy link
Contributor

@mikeland73 mikeland73 left a comment

Choose a reason for hiding this comment

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

Seems safe enough

@savil savil merged commit f729d50 into main Jul 28, 2023
@savil savil deleted the savil/filter-latest-version-env-var branch July 28, 2023 23:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants