Skip to content

Commit 7c3da7c

Browse files
ref(proguard): Define environment variable name in constant (#2265)
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
1 parent ee62421 commit 7c3da7c

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/commands/upload_proguard.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ use crate::utils::proguard_upload;
2323
use crate::utils::system::QuietExit;
2424
use crate::utils::ui::{copy_with_progress, make_byte_progress_bar};
2525

26+
const CHUNK_UPLOAD_ENV_VAR: &str = "SENTRY_EXPERIMENTAL_PROGUARD_CHUNK_UPLOAD";
27+
2628
#[derive(Debug)]
2729
pub struct MappingRef {
2830
pub path: PathBuf,
@@ -206,11 +208,11 @@ pub fn execute(matches: &ArgMatches) -> Result<()> {
206208
let authenticated_api;
207209
let (org, project);
208210

209-
if env::var("SENTRY_EXPERIMENTAL_PROGUARD_CHUNK_UPLOAD") == Ok("1".into()) {
211+
if env::var(CHUNK_UPLOAD_ENV_VAR) == Ok("1".into()) {
210212
log::warn!(
211213
"EXPERIMENTAL FEATURE: Uploading proguard mappings using chunked uploading. \
212214
Some functionality may be unavailable when using chunked uploading. Please unset \
213-
the SENTRY_EXPERIMENTAL_PROGUARD_CHUNK_UPLOAD variable if you encounter any \
215+
the {CHUNK_UPLOAD_ENV_VAR} variable if you encounter any \
214216
problems."
215217
);
216218

@@ -224,7 +226,7 @@ pub fn execute(matches: &ArgMatches) -> Result<()> {
224226
options.ok_or_else(|| {
225227
anyhow::anyhow!(
226228
"server does not support chunked uploading. unset \
227-
SENTRY_EXPERIMENTAL_PROGUARD_CHUNK_UPLOAD to continue."
229+
{CHUNK_UPLOAD_ENV_VAR} to continue."
228230
)
229231
})
230232
})?;

0 commit comments

Comments
 (0)