generated from amazon-archives/__template_Custom
-
Notifications
You must be signed in to change notification settings - Fork 42
refactor : consolidate env variables #871
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
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
6519af5
feat(paths): centralize Amazon Q path management with PathResolver
dk19y 3eb52b7
refactor: consolidate env across codebase
dk19y e325a1d
fix(shell): suppress shellcheck SC2329 warning for __bp_adjust_histco…
dk19y ac90afd
Merge branch 'main' into refactor/consolidate-env
dk19y 65368e2
Merge branch 'main' into refactor/consolidate-env
dk19y 378d6d6
Delete stale todolist file
dk19y 6572ed2
Fix env vars in alacritty terminal & fig_api_client
dk19y d5fdb70
Merge branch 'main' into refactor/consolidate-env
dk19y 18516b1
fix: Fix PR Comments
dk19y 1fb6322
fix(figterm): Replace deprecated cargo_bin with cargo_bin! macro
dk19y 58bede8
fix(q_cli): Replace deprecated cargo_bin with cargo_bin! macro
dk19y File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -49,3 +49,5 @@ book/ | |
| .env* | ||
|
|
||
| run-build.sh | ||
| # Amazon Q CLI files | ||
| .amazonq/ | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -165,6 +165,83 @@ impl Env { | |
| pub fn in_appimage(&self) -> bool { | ||
| self.get_os("APPIMAGE").is_some() | ||
| } | ||
|
|
||
| // Q-specific environment variable methods | ||
| pub fn q_fake_is_remote(&self) -> bool { | ||
| self.get_os("Q_FAKE_IS_REMOTE").is_some() | ||
|
Contributor
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. nit: rename |
||
| } | ||
|
|
||
| pub fn q_log_level(&self) -> Result<String, VarError> { | ||
| self.get("Q_LOG_LEVEL") | ||
| } | ||
|
|
||
| pub fn q_log_stdout(&self) -> bool { | ||
| self.get_os("Q_LOG_STDOUT").is_some() | ||
| } | ||
|
|
||
| pub fn amazon_q_sigv4(&self) -> bool { | ||
| self.get("AMAZON_Q_SIGV4").is_ok_and(|v| !v.is_empty()) | ||
| } | ||
|
|
||
| pub fn amazon_q_chat_shell(&self) -> String { | ||
| self.get("AMAZON_Q_CHAT_SHELL").unwrap_or_else(|_| "bash".to_string()) | ||
| } | ||
|
|
||
| pub fn q_cli_client_application(&self) -> Result<String, VarError> { | ||
| self.get("Q_CLI_CLIENT_APPLICATION") | ||
| } | ||
|
|
||
| pub fn q_parent(&self) -> Result<String, VarError> { | ||
| self.get("Q_PARENT") | ||
| } | ||
|
|
||
| pub fn q_term(&self) -> Result<String, VarError> { | ||
| self.get("Q_TERM") | ||
| } | ||
|
|
||
| pub fn q_using_zsh_autosuggestions(&self) -> bool { | ||
| self.get_os("Q_USING_ZSH_AUTOSUGGESTIONS").is_some() | ||
| } | ||
|
|
||
| pub fn q_init_snapshot_test(&self) -> bool { | ||
| self.get_os("Q_INIT_SNAPSHOT_TEST").is_some() | ||
| } | ||
|
|
||
| pub fn q_desktop_release_url(&self) -> Result<String, VarError> { | ||
| self.get("Q_DESKTOP_RELEASE_URL") | ||
| } | ||
|
|
||
| pub fn q_inline_shell_completion_cache_enabled(&self) -> bool { | ||
| self.get_os("Q_INLINE_SHELL_COMPLETION_CACHE_DISABLE").is_none() | ||
| } | ||
|
|
||
| pub fn q_inline_shell_completion_history_count(&self) -> Result<String, VarError> { | ||
| self.get("Q_INLINE_SHELL_COMPLETION_HISTORY_COUNT") | ||
| } | ||
|
|
||
| pub fn q_inline_shell_completion_debounce_ms(&self) -> Result<String, VarError> { | ||
| self.get("Q_INLINE_SHELL_COMPLETION_DEBOUNCE_MS") | ||
| } | ||
|
|
||
| pub fn q_backend(&self) -> Result<String, VarError> { | ||
| self.get("Q_BACKEND") | ||
| } | ||
|
|
||
| pub fn q_prompt_offset_workaround(&self) -> Result<String, VarError> { | ||
| self.get("Q_PROMPT_OFFSET_WORKAROUND") | ||
| } | ||
|
|
||
| pub fn q_use_sendmessage(&self) -> bool { | ||
| self.get("Q_USE_SENDMESSAGE").is_ok_and(|v| !v.is_empty()) | ||
| } | ||
|
|
||
| pub fn q_custom_cert(&self) -> Result<String, VarError> { | ||
| self.get("Q_CUSTOM_CERT") | ||
| } | ||
|
|
||
| pub fn has_q_parent(&self) -> bool { | ||
| self.q_parent().is_ok() | ||
| } | ||
| } | ||
|
|
||
| impl Shim for Env { | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.