Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions src/commands/mobile_app/upload.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
use std::borrow::Cow;
use std::io::Write;
use std::path::Path;
#[cfg(not(windows))]
use std::fs;
use std::io::Write;
#[cfg(not(windows))]
use std::os::unix::fs::PermissionsExt;
use std::path::Path;

use anyhow::{anyhow, bail, Context as _, Result};
use clap::{Arg, ArgAction, ArgMatches, Command};
Expand Down Expand Up @@ -256,9 +256,14 @@ fn normalize_directory(path: &Path) -> Result<TempFile> {
.filter(|entry| entry.path().is_file())
.map(|entry| {
let entry_path = entry.into_path();
let relative_path = entry_path.strip_prefix(
path.parent().ok_or_else(|| anyhow!("Cannot determine parent directory for path: {}", path.display()))?
)?.to_owned();
let relative_path = entry_path
.strip_prefix(path.parent().ok_or_else(|| {
anyhow!(
"Cannot determine parent directory for path: {}",
path.display()
)
})?)?
.to_owned();
Ok((entry_path, relative_path))
})
.collect::<Result<Vec<_>>>()?
Expand Down
34 changes: 26 additions & 8 deletions src/commands/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,33 @@ use crate::utils::system::{load_dotenv, print_error, set_panic_hook, QuietExit};
use crate::utils::update::run_sentrycli_update_nagger;
use crate::utils::value_parsers::auth_token_parser;

mod bash_hook;
mod debug_files;
mod deploys;
mod derive_parser;
mod events;
mod files;
mod info;
mod issues;
mod login;
mod mobile_app;
mod monitors;
mod organizations;
mod projects;
mod react_native;
mod releases;
mod repos;
mod send_envelope;
mod send_event;
mod send_metric;
mod sourcemaps;
#[cfg(not(feature = "managed"))]
mod uninstall;
#[cfg(not(feature = "managed"))]
mod update;
mod upload_dif;
mod upload_dsym;
mod upload_proguard;

macro_rules! each_subcommand {
($mac:ident) => {
Expand Down Expand Up @@ -53,14 +79,6 @@ macro_rules! each_subcommand {
};
}

macro_rules! import_subcommand {
($name:ident) => {
pub mod $name;
};
}

each_subcommand!(import_subcommand);

const ABOUT: &str = "
Command line utility for Sentry.

Expand Down
4 changes: 1 addition & 3 deletions src/commands/react_native/gradle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,7 @@ pub fn execute(matches: &ArgMatches) -> Result<()> {

if let Some(version) = version {
for dist in matches.get_many::<String>("dist").unwrap() {
println!(
"Uploading sourcemaps for release {version} distribution {dist}"
);
println!("Uploading sourcemaps for release {version} distribution {dist}");

processor.upload(&UploadContext {
org: &org,
Expand Down
2 changes: 1 addition & 1 deletion src/commands/send_metric/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ This command will validate input parameters and attempt to send a metric to \
Sentry. Due to network errors and rate limits, the metric is not guaranteed to \
arrive. Check the debug output for transmission errors by passing --log-level=\
debug or setting `SENTRY_LOG_LEVEL=debug`."))]
#[command(hide=true)]
#[command(hide = true)]
enum SendMetricSubcommand {
#[command(about = format!("[DEPRECATED] {INCREMENT_ABOUT}"))]
#[command(long_about = format!("{DEPRECATION_MESSAGE}{{n}}{{n}}{INCREMENT_ABOUT}"))]
Expand Down
Loading