Skip to content

Commit

Permalink
ref(proguard): Define environment variable name in constant (#2265)
Browse files Browse the repository at this point in the history
Likely would be better to keep this string in a constant to ensure we
don't copy the wrong thing to the places where we use it
  • Loading branch information
szokeasaurusrex authored Nov 26, 2024
1 parent ee62421 commit 7c3da7c
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/commands/upload_proguard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ use crate::utils::proguard_upload;
use crate::utils::system::QuietExit;
use crate::utils::ui::{copy_with_progress, make_byte_progress_bar};

const CHUNK_UPLOAD_ENV_VAR: &str = "SENTRY_EXPERIMENTAL_PROGUARD_CHUNK_UPLOAD";

#[derive(Debug)]
pub struct MappingRef {
pub path: PathBuf,
Expand Down Expand Up @@ -206,11 +208,11 @@ pub fn execute(matches: &ArgMatches) -> Result<()> {
let authenticated_api;
let (org, project);

if env::var("SENTRY_EXPERIMENTAL_PROGUARD_CHUNK_UPLOAD") == Ok("1".into()) {
if env::var(CHUNK_UPLOAD_ENV_VAR) == Ok("1".into()) {
log::warn!(
"EXPERIMENTAL FEATURE: Uploading proguard mappings using chunked uploading. \
Some functionality may be unavailable when using chunked uploading. Please unset \
the SENTRY_EXPERIMENTAL_PROGUARD_CHUNK_UPLOAD variable if you encounter any \
the {CHUNK_UPLOAD_ENV_VAR} variable if you encounter any \
problems."
);

Expand All @@ -224,7 +226,7 @@ pub fn execute(matches: &ArgMatches) -> Result<()> {
options.ok_or_else(|| {
anyhow::anyhow!(
"server does not support chunked uploading. unset \
SENTRY_EXPERIMENTAL_PROGUARD_CHUNK_UPLOAD to continue."
{CHUNK_UPLOAD_ENV_VAR} to continue."
)
})
})?;
Expand Down

0 comments on commit 7c3da7c

Please sign in to comment.