Skip to content

feat(lk): env command preserves existing file content unless --overwrite#846

Merged
rektdeckard merged 3 commits into
mainfrom
tobiasfried/grw-547-improve-lk-app-env-write-ergonomics
May 22, 2026
Merged

feat(lk): env command preserves existing file content unless --overwrite#846
rektdeckard merged 3 commits into
mainfrom
tobiasfried/grw-547-improve-lk-app-env-write-ergonomics

Conversation

@rektdeckard
Copy link
Copy Markdown
Member

@rektdeckard rektdeckard commented May 21, 2026

https://linear.app/livekit/issue/GRW-547/improve-lk-app-env-write-ergonomics

  • lk app env --write now preserves existing entries in the target file (upserting only the vars we touch)
  • This behavior can be overridden with --overwrite

Sorry, this was an old ticket that got lost 😅

@rektdeckard rektdeckard requested review from a team, bcherry and mike-r-mclaughlin May 21, 2026 18:00
Copy link
Copy Markdown
Contributor

@Topherhindman Topherhindman left a comment

Choose a reason for hiding this comment

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

this seems fine, however, i feel like dotenv files have enough weird cases that it'd be good for us to have some coverage for. some that could be good:

  • preserves comments/blank lines
  • updates existing keys
  • appends missing keys
  • keeps export
  • handles inline comments
  • handles missing destination file
  • verifies overwrite=true still fully replaces

Comment thread pkg/bootstrap/bootstrap.go
Comment thread pkg/portaudio/pa_src
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

is this change intentional?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

It is unintentional but permissible 😆

@rektdeckard rektdeckard merged commit 93fd218 into main May 22, 2026
17 checks passed
@rektdeckard rektdeckard deleted the tobiasfried/grw-547-improve-lk-app-env-write-ergonomics branch May 22, 2026 00:34
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.

2 participants