sentry-cli 2.30.2__tar.gz → 2.30.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {sentry_cli-2.30.2 → sentry_cli-2.30.3}/Cargo.lock +1 -1
- {sentry_cli-2.30.2 → sentry_cli-2.30.3}/Cargo.toml +1 -1
- {sentry_cli-2.30.2 → sentry_cli-2.30.3}/PKG-INFO +1 -1
- {sentry_cli-2.30.2 → sentry_cli-2.30.3}/sentry_cli.egg-info/PKG-INFO +1 -1
- {sentry_cli-2.30.2 → sentry_cli-2.30.3}/sentry_cli.egg-info/SOURCES.txt +0 -2
- {sentry_cli-2.30.2 → sentry_cli-2.30.3}/src/api.rs +7 -22
- {sentry_cli-2.30.2 → sentry_cli-2.30.3}/src/commands/mod.rs +9 -1
- {sentry_cli-2.30.2 → sentry_cli-2.30.3}/src/config.rs +3 -1
- {sentry_cli-2.30.2 → sentry_cli-2.30.3}/src/main.rs +6 -6
- {sentry_cli-2.30.2 → sentry_cli-2.30.3}/src/utils/dif_upload.rs +15 -63
- {sentry_cli-2.30.2 → sentry_cli-2.30.3}/src/utils/file_search.rs +0 -16
- {sentry_cli-2.30.2 → sentry_cli-2.30.3}/src/utils/file_upload.rs +0 -5
- {sentry_cli-2.30.2 → sentry_cli-2.30.3}/src/utils/fs.rs +2 -6
- {sentry_cli-2.30.2 → sentry_cli-2.30.3}/src/utils/mod.rs +0 -2
- {sentry_cli-2.30.2 → sentry_cli-2.30.3}/src/utils/progress.rs +1 -11
- {sentry_cli-2.30.2 → sentry_cli-2.30.3}/src/utils/system.rs +28 -61
- {sentry_cli-2.30.2 → sentry_cli-2.30.3}/src/utils/xcode.rs +16 -11
- sentry_cli-2.30.2/src/utils/codepush.rs +0 -140
- sentry_cli-2.30.2/src/utils/enc.rs +0 -31
- {sentry_cli-2.30.2 → sentry_cli-2.30.3}/LICENSE +0 -0
- {sentry_cli-2.30.2 → sentry_cli-2.30.3}/MANIFEST.in +0 -0
- {sentry_cli-2.30.2 → sentry_cli-2.30.3}/README.md +0 -0
- {sentry_cli-2.30.2 → sentry_cli-2.30.3}/build.rs +0 -0
- {sentry_cli-2.30.2 → sentry_cli-2.30.3}/pyproject.toml +0 -0
- {sentry_cli-2.30.2 → sentry_cli-2.30.3}/sentry_cli.egg-info/dependency_links.txt +0 -0
- {sentry_cli-2.30.2 → sentry_cli-2.30.3}/sentry_cli.egg-info/top_level.txt +0 -0
- {sentry_cli-2.30.2 → sentry_cli-2.30.3}/setup.cfg +0 -0
- {sentry_cli-2.30.2 → sentry_cli-2.30.3}/setup.py +0 -0
- {sentry_cli-2.30.2 → sentry_cli-2.30.3}/src/bashsupport.sh +0 -0
- {sentry_cli-2.30.2 → sentry_cli-2.30.3}/src/commands/bash_hook.rs +0 -0
- {sentry_cli-2.30.2 → sentry_cli-2.30.3}/src/commands/debug_files/bundle_jvm.rs +0 -0
- {sentry_cli-2.30.2 → sentry_cli-2.30.3}/src/commands/debug_files/bundle_sources.rs +0 -0
- {sentry_cli-2.30.2 → sentry_cli-2.30.3}/src/commands/debug_files/check.rs +0 -0
- {sentry_cli-2.30.2 → sentry_cli-2.30.3}/src/commands/debug_files/find.rs +0 -0
- {sentry_cli-2.30.2 → sentry_cli-2.30.3}/src/commands/debug_files/mod.rs +0 -0
- {sentry_cli-2.30.2 → sentry_cli-2.30.3}/src/commands/debug_files/print_sources.rs +0 -0
- {sentry_cli-2.30.2 → sentry_cli-2.30.3}/src/commands/debug_files/upload.rs +0 -0
- {sentry_cli-2.30.2 → sentry_cli-2.30.3}/src/commands/deploys/list.rs +0 -0
- {sentry_cli-2.30.2 → sentry_cli-2.30.3}/src/commands/deploys/mod.rs +0 -0
- {sentry_cli-2.30.2 → sentry_cli-2.30.3}/src/commands/deploys/new.rs +0 -0
- {sentry_cli-2.30.2 → sentry_cli-2.30.3}/src/commands/events/list.rs +0 -0
- {sentry_cli-2.30.2 → sentry_cli-2.30.3}/src/commands/events/mod.rs +0 -0
- {sentry_cli-2.30.2 → sentry_cli-2.30.3}/src/commands/files/delete.rs +0 -0
- {sentry_cli-2.30.2 → sentry_cli-2.30.3}/src/commands/files/list.rs +0 -0
- {sentry_cli-2.30.2 → sentry_cli-2.30.3}/src/commands/files/mod.rs +0 -0
- {sentry_cli-2.30.2 → sentry_cli-2.30.3}/src/commands/files/upload.rs +0 -0
- {sentry_cli-2.30.2 → sentry_cli-2.30.3}/src/commands/info.rs +0 -0
- {sentry_cli-2.30.2 → sentry_cli-2.30.3}/src/commands/issues/list.rs +0 -0
- {sentry_cli-2.30.2 → sentry_cli-2.30.3}/src/commands/issues/mod.rs +0 -0
- {sentry_cli-2.30.2 → sentry_cli-2.30.3}/src/commands/issues/mute.rs +0 -0
- {sentry_cli-2.30.2 → sentry_cli-2.30.3}/src/commands/issues/resolve.rs +0 -0
- {sentry_cli-2.30.2 → sentry_cli-2.30.3}/src/commands/issues/unresolve.rs +0 -0
- {sentry_cli-2.30.2 → sentry_cli-2.30.3}/src/commands/login.rs +0 -0
- {sentry_cli-2.30.2 → sentry_cli-2.30.3}/src/commands/monitors/list.rs +0 -0
- {sentry_cli-2.30.2 → sentry_cli-2.30.3}/src/commands/monitors/mod.rs +0 -0
- {sentry_cli-2.30.2 → sentry_cli-2.30.3}/src/commands/monitors/run.rs +0 -0
- {sentry_cli-2.30.2 → sentry_cli-2.30.3}/src/commands/organizations/list.rs +0 -0
- {sentry_cli-2.30.2 → sentry_cli-2.30.3}/src/commands/organizations/mod.rs +0 -0
- {sentry_cli-2.30.2 → sentry_cli-2.30.3}/src/commands/projects/list.rs +0 -0
- {sentry_cli-2.30.2 → sentry_cli-2.30.3}/src/commands/projects/mod.rs +0 -0
- {sentry_cli-2.30.2 → sentry_cli-2.30.3}/src/commands/react_native/appcenter.rs +0 -0
- {sentry_cli-2.30.2 → sentry_cli-2.30.3}/src/commands/react_native/gradle.rs +0 -0
- {sentry_cli-2.30.2 → sentry_cli-2.30.3}/src/commands/react_native/mod.rs +0 -0
- {sentry_cli-2.30.2 → sentry_cli-2.30.3}/src/commands/react_native/xcode.rs +0 -0
- {sentry_cli-2.30.2 → sentry_cli-2.30.3}/src/commands/releases/archive.rs +0 -0
- {sentry_cli-2.30.2 → sentry_cli-2.30.3}/src/commands/releases/delete.rs +0 -0
- {sentry_cli-2.30.2 → sentry_cli-2.30.3}/src/commands/releases/finalize.rs +0 -0
- {sentry_cli-2.30.2 → sentry_cli-2.30.3}/src/commands/releases/info.rs +0 -0
- {sentry_cli-2.30.2 → sentry_cli-2.30.3}/src/commands/releases/list.rs +0 -0
- {sentry_cli-2.30.2 → sentry_cli-2.30.3}/src/commands/releases/mod.rs +0 -0
- {sentry_cli-2.30.2 → sentry_cli-2.30.3}/src/commands/releases/new.rs +0 -0
- {sentry_cli-2.30.2 → sentry_cli-2.30.3}/src/commands/releases/propose_version.rs +0 -0
- {sentry_cli-2.30.2 → sentry_cli-2.30.3}/src/commands/releases/restore.rs +0 -0
- {sentry_cli-2.30.2 → sentry_cli-2.30.3}/src/commands/releases/set_commits.rs +0 -0
- {sentry_cli-2.30.2 → sentry_cli-2.30.3}/src/commands/repos/list.rs +0 -0
- {sentry_cli-2.30.2 → sentry_cli-2.30.3}/src/commands/repos/mod.rs +0 -0
- {sentry_cli-2.30.2 → sentry_cli-2.30.3}/src/commands/send_envelope.rs +0 -0
- {sentry_cli-2.30.2 → sentry_cli-2.30.3}/src/commands/send_event.rs +0 -0
- {sentry_cli-2.30.2 → sentry_cli-2.30.3}/src/commands/sourcemaps/explain.rs +0 -0
- {sentry_cli-2.30.2 → sentry_cli-2.30.3}/src/commands/sourcemaps/inject.rs +0 -0
- {sentry_cli-2.30.2 → sentry_cli-2.30.3}/src/commands/sourcemaps/mod.rs +0 -0
- {sentry_cli-2.30.2 → sentry_cli-2.30.3}/src/commands/sourcemaps/resolve.rs +0 -0
- {sentry_cli-2.30.2 → sentry_cli-2.30.3}/src/commands/sourcemaps/upload.rs +0 -0
- {sentry_cli-2.30.2 → sentry_cli-2.30.3}/src/commands/uninstall.rs +0 -0
- {sentry_cli-2.30.2 → sentry_cli-2.30.3}/src/commands/update.rs +0 -0
- {sentry_cli-2.30.2 → sentry_cli-2.30.3}/src/commands/upload_dif.rs +0 -0
- {sentry_cli-2.30.2 → sentry_cli-2.30.3}/src/commands/upload_dsym.rs +0 -0
- {sentry_cli-2.30.2 → sentry_cli-2.30.3}/src/commands/upload_proguard.rs +0 -0
- {sentry_cli-2.30.2 → sentry_cli-2.30.3}/src/constants.rs +0 -0
- {sentry_cli-2.30.2 → sentry_cli-2.30.3}/src/utils/android.rs +0 -0
- {sentry_cli-2.30.2 → sentry_cli-2.30.3}/src/utils/appcenter.rs +0 -0
- {sentry_cli-2.30.2 → sentry_cli-2.30.3}/src/utils/args.rs +0 -0
- {sentry_cli-2.30.2 → sentry_cli-2.30.3}/src/utils/auth_token/auth_token_impl.rs +0 -0
- {sentry_cli-2.30.2 → sentry_cli-2.30.3}/src/utils/auth_token/error.rs +0 -0
- {sentry_cli-2.30.2 → sentry_cli-2.30.3}/src/utils/auth_token/mod.rs +0 -0
- {sentry_cli-2.30.2 → sentry_cli-2.30.3}/src/utils/auth_token/org_auth_token.rs +0 -0
- {sentry_cli-2.30.2 → sentry_cli-2.30.3}/src/utils/auth_token/test.rs +0 -0
- {sentry_cli-2.30.2 → sentry_cli-2.30.3}/src/utils/auth_token/user_auth_token.rs +0 -0
- {sentry_cli-2.30.2 → sentry_cli-2.30.3}/src/utils/chunks.rs +0 -0
- {sentry_cli-2.30.2 → sentry_cli-2.30.3}/src/utils/cordova.rs +0 -0
- {sentry_cli-2.30.2 → sentry_cli-2.30.3}/src/utils/dif.rs +0 -0
- {sentry_cli-2.30.2 → sentry_cli-2.30.3}/src/utils/event.rs +0 -0
- {sentry_cli-2.30.2 → sentry_cli-2.30.3}/src/utils/formatting.rs +0 -0
- {sentry_cli-2.30.2 → sentry_cli-2.30.3}/src/utils/http.rs +0 -0
- {sentry_cli-2.30.2 → sentry_cli-2.30.3}/src/utils/logging.rs +0 -0
- {sentry_cli-2.30.2 → sentry_cli-2.30.3}/src/utils/releases.rs +0 -0
- {sentry_cli-2.30.2 → sentry_cli-2.30.3}/src/utils/retry.rs +0 -0
- {sentry_cli-2.30.2 → sentry_cli-2.30.3}/src/utils/snapshots/sentry_cli__utils__vcs__generate_patch_default_twenty.snap +0 -0
- {sentry_cli-2.30.2 → sentry_cli-2.30.3}/src/utils/snapshots/sentry_cli__utils__vcs__generate_patch_ignore_missing.snap +0 -0
- {sentry_cli-2.30.2 → sentry_cli-2.30.3}/src/utils/snapshots/sentry_cli__utils__vcs__generate_patch_set_base.snap +0 -0
- {sentry_cli-2.30.2 → sentry_cli-2.30.3}/src/utils/snapshots/sentry_cli__utils__vcs__generate_patch_set_previous_commit.snap +0 -0
- {sentry_cli-2.30.2 → sentry_cli-2.30.3}/src/utils/snapshots/sentry_cli__utils__vcs__get_commits_from_git.snap +0 -0
- {sentry_cli-2.30.2 → sentry_cli-2.30.3}/src/utils/sourcemaps/inject.rs +0 -0
- {sentry_cli-2.30.2 → sentry_cli-2.30.3}/src/utils/sourcemaps.rs +0 -0
- {sentry_cli-2.30.2 → sentry_cli-2.30.3}/src/utils/ui.rs +0 -0
- {sentry_cli-2.30.2 → sentry_cli-2.30.3}/src/utils/update.rs +0 -0
- {sentry_cli-2.30.2 → sentry_cli-2.30.3}/src/utils/vcs.rs +0 -0
|
@@ -80,11 +80,9 @@ src/utils/android.rs
|
|
|
80
80
|
src/utils/appcenter.rs
|
|
81
81
|
src/utils/args.rs
|
|
82
82
|
src/utils/chunks.rs
|
|
83
|
-
src/utils/codepush.rs
|
|
84
83
|
src/utils/cordova.rs
|
|
85
84
|
src/utils/dif.rs
|
|
86
85
|
src/utils/dif_upload.rs
|
|
87
|
-
src/utils/enc.rs
|
|
88
86
|
src/utils/event.rs
|
|
89
87
|
src/utils/file_search.rs
|
|
90
88
|
src/utils/file_upload.rs
|
|
@@ -18,7 +18,9 @@ use std::{env, fmt};
|
|
|
18
18
|
use anyhow::{Context, Result};
|
|
19
19
|
use backoff::backoff::Backoff;
|
|
20
20
|
use brotli2::write::BrotliEncoder;
|
|
21
|
-
|
|
21
|
+
#[cfg(target_os = "macos")]
|
|
22
|
+
use chrono::Duration;
|
|
23
|
+
use chrono::{DateTime, FixedOffset, Utc};
|
|
22
24
|
use clap::ArgMatches;
|
|
23
25
|
use flate2::write::GzEncoder;
|
|
24
26
|
use if_chain::if_chain;
|
|
@@ -158,7 +160,6 @@ pub enum ProgressBarMode {
|
|
|
158
160
|
Disabled,
|
|
159
161
|
Request,
|
|
160
162
|
Response,
|
|
161
|
-
Both,
|
|
162
163
|
Shared((Arc<ProgressBar>, u64, usize, Arc<RwLock<Vec<u64>>>)),
|
|
163
164
|
}
|
|
164
165
|
|
|
@@ -170,12 +171,12 @@ impl ProgressBarMode {
|
|
|
170
171
|
|
|
171
172
|
/// Returns whether a progress bar should be displayed during upload.
|
|
172
173
|
pub fn request(&self) -> bool {
|
|
173
|
-
matches!(*self, ProgressBarMode::Request
|
|
174
|
+
matches!(*self, ProgressBarMode::Request)
|
|
174
175
|
}
|
|
175
176
|
|
|
176
177
|
/// Returns whether a progress bar should be displayed during download.
|
|
177
178
|
pub fn response(&self) -> bool {
|
|
178
|
-
matches!(*self, ProgressBarMode::Response
|
|
179
|
+
matches!(*self, ProgressBarMode::Response)
|
|
179
180
|
}
|
|
180
181
|
}
|
|
181
182
|
|
|
@@ -324,7 +325,6 @@ pub type ApiResult<T> = Result<T, ApiError>;
|
|
|
324
325
|
#[derive(Eq, PartialEq, Debug)]
|
|
325
326
|
pub enum Method {
|
|
326
327
|
Get,
|
|
327
|
-
Head,
|
|
328
328
|
Post,
|
|
329
329
|
Put,
|
|
330
330
|
Delete,
|
|
@@ -334,7 +334,6 @@ impl fmt::Display for Method {
|
|
|
334
334
|
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
|
335
335
|
match *self {
|
|
336
336
|
Method::Get => write!(f, "GET"),
|
|
337
|
-
Method::Head => write!(f, "HEAD"),
|
|
338
337
|
Method::Post => write!(f, "POST"),
|
|
339
338
|
Method::Put => write!(f, "PUT"),
|
|
340
339
|
Method::Delete => write!(f, "DELETE"),
|
|
@@ -532,7 +531,8 @@ impl Api {
|
|
|
532
531
|
}
|
|
533
532
|
|
|
534
533
|
/// Convenience method that waits for a few seconds until a resource
|
|
535
|
-
/// becomes available.
|
|
534
|
+
/// becomes available. We only use this in the macOS binary.
|
|
535
|
+
#[cfg(target_os = "macos")]
|
|
536
536
|
pub fn wait_until_available(&self, url: &str, duration: Duration) -> ApiResult<bool> {
|
|
537
537
|
let started = Utc::now();
|
|
538
538
|
loop {
|
|
@@ -1851,11 +1851,6 @@ impl ApiRequest {
|
|
|
1851
1851
|
|
|
1852
1852
|
match method {
|
|
1853
1853
|
Method::Get => handle.get(true)?,
|
|
1854
|
-
Method::Head => {
|
|
1855
|
-
handle.get(true)?;
|
|
1856
|
-
handle.custom_request("HEAD")?;
|
|
1857
|
-
handle.nobody(true)?;
|
|
1858
|
-
}
|
|
1859
1854
|
Method::Post => handle.custom_request("POST")?,
|
|
1860
1855
|
Method::Put => handle.custom_request("PUT")?,
|
|
1861
1856
|
Method::Delete => handle.custom_request("DELETE")?,
|
|
@@ -2235,16 +2230,6 @@ pub struct Artifact {
|
|
|
2235
2230
|
}
|
|
2236
2231
|
|
|
2237
2232
|
impl Artifact {
|
|
2238
|
-
pub fn get_header<'a>(&'a self, key: &str) -> Option<&'a str> {
|
|
2239
|
-
let ikey = key.to_lowercase();
|
|
2240
|
-
for (k, v) in &self.headers {
|
|
2241
|
-
if k.to_lowercase() == ikey {
|
|
2242
|
-
return Some(v.as_str());
|
|
2243
|
-
}
|
|
2244
|
-
}
|
|
2245
|
-
None
|
|
2246
|
-
}
|
|
2247
|
-
|
|
2248
2233
|
pub fn get_sourcemap_reference(&self) -> Option<&str> {
|
|
2249
2234
|
get_sourcemap_reference_from_headers(self.headers.iter())
|
|
2250
2235
|
}
|
|
@@ -308,12 +308,20 @@ pub fn execute() -> Result<()> {
|
|
|
308
308
|
|
|
309
309
|
fn setup() {
|
|
310
310
|
init_backtrace();
|
|
311
|
-
|
|
311
|
+
|
|
312
|
+
// Store the result of loading the dotenv file. We must load the dotenv file
|
|
313
|
+
// before setting the log level, as the log level can be set in the dotenv
|
|
314
|
+
// file, but we should only log a warning after setting the log level.
|
|
315
|
+
let load_dotenv_result = load_dotenv();
|
|
312
316
|
|
|
313
317
|
// we use debug internally but our log handler then rejects to a lower limit.
|
|
314
318
|
// This is okay for our uses but not as efficient.
|
|
315
319
|
set_max_level(LevelFilter::Debug);
|
|
316
320
|
set_logger(&Logger).unwrap();
|
|
321
|
+
|
|
322
|
+
if let Err(e) = load_dotenv_result {
|
|
323
|
+
log::warn!("Failed to load .env file: {}", e);
|
|
324
|
+
}
|
|
317
325
|
}
|
|
318
326
|
|
|
319
327
|
/// Executes the command line application and exits the process.
|
|
@@ -431,7 +431,9 @@ impl Config {
|
|
|
431
431
|
)
|
|
432
432
|
}
|
|
433
433
|
|
|
434
|
-
/// Returns true if notifications should be displayed
|
|
434
|
+
/// Returns true if notifications should be displayed.
|
|
435
|
+
/// We only use this function in the macOS binary.
|
|
436
|
+
#[cfg(target_os = "macos")]
|
|
435
437
|
pub fn show_notifications(&self) -> Result<bool> {
|
|
436
438
|
Ok(self
|
|
437
439
|
.ini
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
//! exported function is `main` which is directly invoked from the
|
|
3
3
|
//! compiled binary that links against this library.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
mod api;
|
|
6
|
+
mod commands;
|
|
7
|
+
mod config;
|
|
8
|
+
mod constants;
|
|
9
|
+
mod utils;
|
|
10
10
|
|
|
11
11
|
/// Executes the command line application and exits the process.
|
|
12
12
|
pub fn main() {
|
|
13
|
-
|
|
13
|
+
commands::main()
|
|
14
14
|
}
|
|
@@ -78,8 +78,8 @@ impl<'a> Iterator for DifChunks<'a> {
|
|
|
78
78
|
/// [`DifMatch`] instead of this instead.
|
|
79
79
|
enum ParsedDif<'a> {
|
|
80
80
|
Object(Box<Object<'a>>),
|
|
81
|
-
BcSymbolMap
|
|
82
|
-
UuidMap
|
|
81
|
+
BcSymbolMap,
|
|
82
|
+
UuidMap,
|
|
83
83
|
Il2Cpp,
|
|
84
84
|
}
|
|
85
85
|
|
|
@@ -98,7 +98,7 @@ impl<'slf, 'data: 'slf> AsSelf<'slf> for ParsedDif<'data> {
|
|
|
98
98
|
/// disposed along with a `DifMatch` once it is dropped.
|
|
99
99
|
#[derive(Debug)]
|
|
100
100
|
enum DifBacking {
|
|
101
|
-
Temp
|
|
101
|
+
Temp,
|
|
102
102
|
}
|
|
103
103
|
|
|
104
104
|
/// A handle to a debug information file found by `DifUpload`.
|
|
@@ -125,7 +125,7 @@ impl<'data> DifMatch<'data> {
|
|
|
125
125
|
})?;
|
|
126
126
|
|
|
127
127
|
Ok(DifMatch {
|
|
128
|
-
_backing: Some(DifBacking::Temp
|
|
128
|
+
_backing: Some(DifBacking::Temp),
|
|
129
129
|
dif,
|
|
130
130
|
name: name.into(),
|
|
131
131
|
debug_id,
|
|
@@ -145,7 +145,7 @@ impl<'data> DifMatch<'data> {
|
|
|
145
145
|
let dif = SelfCell::try_new(buffer, |_| Ok::<_, anyhow::Error>(ParsedDif::Il2Cpp))?;
|
|
146
146
|
|
|
147
147
|
Ok(DifMatch {
|
|
148
|
-
_backing: Some(DifBacking::Temp
|
|
148
|
+
_backing: Some(DifBacking::Temp),
|
|
149
149
|
dif,
|
|
150
150
|
name: name.into(),
|
|
151
151
|
debug_id,
|
|
@@ -158,7 +158,7 @@ impl<'data> DifMatch<'data> {
|
|
|
158
158
|
/// Normally the filename should be the `uuid` with `.bcsymbolmap` appended to it.
|
|
159
159
|
fn from_bcsymbolmap(uuid: DebugId, name: String, data: ByteView<'static>) -> Result<Self> {
|
|
160
160
|
let dif = SelfCell::try_new(data, |buf| {
|
|
161
|
-
BcSymbolMap::parse(unsafe { &*buf }).map(ParsedDif::BcSymbolMap)
|
|
161
|
+
BcSymbolMap::parse(unsafe { &*buf }).map(|_| ParsedDif::BcSymbolMap)
|
|
162
162
|
})?;
|
|
163
163
|
|
|
164
164
|
Ok(Self {
|
|
@@ -172,7 +172,7 @@ impl<'data> DifMatch<'data> {
|
|
|
172
172
|
|
|
173
173
|
fn from_plist(uuid: DebugId, name: String, data: ByteView<'static>) -> Result<Self> {
|
|
174
174
|
let dif = SelfCell::try_new(data, |buf| {
|
|
175
|
-
UuidMapping::parse_plist(uuid, unsafe { &*buf }).map(ParsedDif::UuidMap)
|
|
175
|
+
UuidMapping::parse_plist(uuid, unsafe { &*buf }).map(|_| ParsedDif::UuidMap)
|
|
176
176
|
})?;
|
|
177
177
|
|
|
178
178
|
Ok(Self {
|
|
@@ -205,8 +205,8 @@ impl<'data> DifMatch<'data> {
|
|
|
205
205
|
pub fn object(&self) -> Option<&Object<'data>> {
|
|
206
206
|
match self.dif.get() {
|
|
207
207
|
ParsedDif::Object(ref obj) => Some(obj),
|
|
208
|
-
ParsedDif::BcSymbolMap
|
|
209
|
-
ParsedDif::UuidMap
|
|
208
|
+
ParsedDif::BcSymbolMap => None,
|
|
209
|
+
ParsedDif::UuidMap => None,
|
|
210
210
|
ParsedDif::Il2Cpp => None,
|
|
211
211
|
}
|
|
212
212
|
}
|
|
@@ -214,8 +214,8 @@ impl<'data> DifMatch<'data> {
|
|
|
214
214
|
pub fn format(&self) -> DifFormat {
|
|
215
215
|
match self.dif.get() {
|
|
216
216
|
ParsedDif::Object(ref object) => DifFormat::Object(object.file_format()),
|
|
217
|
-
ParsedDif::BcSymbolMap
|
|
218
|
-
ParsedDif::UuidMap
|
|
217
|
+
ParsedDif::BcSymbolMap => DifFormat::BcSymbolMap,
|
|
218
|
+
ParsedDif::UuidMap => DifFormat::PList,
|
|
219
219
|
ParsedDif::Il2Cpp => DifFormat::Il2Cpp,
|
|
220
220
|
}
|
|
221
221
|
}
|
|
@@ -224,8 +224,8 @@ impl<'data> DifMatch<'data> {
|
|
|
224
224
|
pub fn data(&self) -> &[u8] {
|
|
225
225
|
match self.dif.get() {
|
|
226
226
|
ParsedDif::Object(ref obj) => obj.data(),
|
|
227
|
-
ParsedDif::BcSymbolMap
|
|
228
|
-
ParsedDif::UuidMap
|
|
227
|
+
ParsedDif::BcSymbolMap => self.dif.owner(),
|
|
228
|
+
ParsedDif::UuidMap => self.dif.owner(),
|
|
229
229
|
ParsedDif::Il2Cpp => self.dif.owner(),
|
|
230
230
|
}
|
|
231
231
|
}
|
|
@@ -1515,8 +1515,8 @@ fn poll_dif_assemble(
|
|
|
1515
1515
|
symbolic::debuginfo::ObjectKind::None => String::new(),
|
|
1516
1516
|
k => format!(" {k:#}"),
|
|
1517
1517
|
},
|
|
1518
|
-
ParsedDif::BcSymbolMap
|
|
1519
|
-
ParsedDif::UuidMap
|
|
1518
|
+
ParsedDif::BcSymbolMap => String::from("bcsymbolmap"),
|
|
1519
|
+
ParsedDif::UuidMap => String::from("uuidmap"),
|
|
1520
1520
|
ParsedDif::Il2Cpp => String::from("il2cpp"),
|
|
1521
1521
|
};
|
|
1522
1522
|
|
|
@@ -1876,17 +1876,6 @@ impl DifUpload {
|
|
|
1876
1876
|
self
|
|
1877
1877
|
}
|
|
1878
1878
|
|
|
1879
|
-
/// Add a `DebugId` to filter for.
|
|
1880
|
-
///
|
|
1881
|
-
/// By default, all DebugIds will be included.
|
|
1882
|
-
pub fn filter_id<I>(&mut self, id: I) -> &mut Self
|
|
1883
|
-
where
|
|
1884
|
-
I: Into<DebugId>,
|
|
1885
|
-
{
|
|
1886
|
-
self.ids.insert(id.into());
|
|
1887
|
-
self
|
|
1888
|
-
}
|
|
1889
|
-
|
|
1890
1879
|
/// Add `DebugId`s to filter for.
|
|
1891
1880
|
///
|
|
1892
1881
|
/// By default, all DebugIds will be included. If `ids` is empty, this will
|
|
@@ -1910,18 +1899,6 @@ impl DifUpload {
|
|
|
1910
1899
|
self
|
|
1911
1900
|
}
|
|
1912
1901
|
|
|
1913
|
-
/// Add `FileFormat`s to filter for.
|
|
1914
|
-
///
|
|
1915
|
-
/// By default, all object formats will be included. If `formats` is empty, this
|
|
1916
|
-
/// will not be changed.
|
|
1917
|
-
pub fn filter_formats<I>(&mut self, formats: I) -> &mut Self
|
|
1918
|
-
where
|
|
1919
|
-
I: IntoIterator<Item = DifFormat>,
|
|
1920
|
-
{
|
|
1921
|
-
self.formats.extend(formats);
|
|
1922
|
-
self
|
|
1923
|
-
}
|
|
1924
|
-
|
|
1925
1902
|
/// Add an `ObjectFeature` to filter for.
|
|
1926
1903
|
///
|
|
1927
1904
|
/// By default, all object features will be included.
|
|
@@ -1930,31 +1907,6 @@ impl DifUpload {
|
|
|
1930
1907
|
self
|
|
1931
1908
|
}
|
|
1932
1909
|
|
|
1933
|
-
/// Add a file extension to filter for.
|
|
1934
|
-
///
|
|
1935
|
-
/// By default, all file extensions will be included.
|
|
1936
|
-
pub fn filter_extension<S>(&mut self, extension: S) -> &mut Self
|
|
1937
|
-
where
|
|
1938
|
-
S: Into<OsString>,
|
|
1939
|
-
{
|
|
1940
|
-
self.extensions.insert(extension.into());
|
|
1941
|
-
self
|
|
1942
|
-
}
|
|
1943
|
-
|
|
1944
|
-
/// Add a file extension to filter for.
|
|
1945
|
-
///
|
|
1946
|
-
/// By default, all file extensions will be included.
|
|
1947
|
-
pub fn filter_extensions<I>(&mut self, extensions: I) -> &mut Self
|
|
1948
|
-
where
|
|
1949
|
-
I: IntoIterator,
|
|
1950
|
-
I::Item: Into<OsString>,
|
|
1951
|
-
{
|
|
1952
|
-
for extension in extensions {
|
|
1953
|
-
self.extensions.insert(extension.into());
|
|
1954
|
-
}
|
|
1955
|
-
self
|
|
1956
|
-
}
|
|
1957
|
-
|
|
1958
1910
|
/// Set a path containing BCSymbolMaps to resolve hidden symbols in dSYMs
|
|
1959
1911
|
/// obtained from iTunes Connect. This requires the `dsymutil` command.
|
|
1960
1912
|
///
|
|
@@ -45,14 +45,6 @@ impl ReleaseFileSearch {
|
|
|
45
45
|
self
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
-
pub fn extension<E>(&mut self, extension: E) -> &mut Self
|
|
49
|
-
where
|
|
50
|
-
E: Into<String>,
|
|
51
|
-
{
|
|
52
|
-
self.extensions.insert(extension.into());
|
|
53
|
-
self
|
|
54
|
-
}
|
|
55
|
-
|
|
56
48
|
pub fn extensions<E>(&mut self, extensions: E) -> &mut Self
|
|
57
49
|
where
|
|
58
50
|
E: IntoIterator,
|
|
@@ -64,14 +56,6 @@ impl ReleaseFileSearch {
|
|
|
64
56
|
self
|
|
65
57
|
}
|
|
66
58
|
|
|
67
|
-
pub fn ignore<I>(&mut self, ignore: I) -> &mut Self
|
|
68
|
-
where
|
|
69
|
-
I: Into<String>,
|
|
70
|
-
{
|
|
71
|
-
self.ignores.insert(ignore.into());
|
|
72
|
-
self
|
|
73
|
-
}
|
|
74
|
-
|
|
75
59
|
pub fn ignores<I>(&mut self, ignores: I) -> &mut Self
|
|
76
60
|
where
|
|
77
61
|
I: IntoIterator,
|
|
@@ -144,11 +144,6 @@ impl SourceFile {
|
|
|
144
144
|
self.headers.insert("debug-id".to_string(), debug_id);
|
|
145
145
|
}
|
|
146
146
|
|
|
147
|
-
/// Returns the value of the "Sourcemap" header.
|
|
148
|
-
pub fn sourcemap_reference(&self) -> Option<&String> {
|
|
149
|
-
self.headers.get("Sourcemap")
|
|
150
|
-
}
|
|
151
|
-
|
|
152
147
|
/// Sets the value of the "Sourcemap" header.
|
|
153
148
|
pub fn set_sourcemap_reference(&mut self, sourcemap: String) {
|
|
154
149
|
self.headers.insert("Sourcemap".to_string(), sourcemap);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
use std::env;
|
|
2
2
|
use std::fs;
|
|
3
3
|
use std::io;
|
|
4
|
-
use std::io::{Read, Seek
|
|
4
|
+
use std::io::{Read, Seek};
|
|
5
5
|
use std::path::{Path, PathBuf};
|
|
6
6
|
|
|
7
7
|
use anyhow::{bail, Result};
|
|
@@ -72,6 +72,7 @@ impl TempFile {
|
|
|
72
72
|
.read(true)
|
|
73
73
|
.write(true)
|
|
74
74
|
.create(true)
|
|
75
|
+
.truncate(false)
|
|
75
76
|
.open(&self.path)?;
|
|
76
77
|
|
|
77
78
|
f.rewind().ok();
|
|
@@ -82,11 +83,6 @@ impl TempFile {
|
|
|
82
83
|
pub fn path(&self) -> &Path {
|
|
83
84
|
&self.path
|
|
84
85
|
}
|
|
85
|
-
|
|
86
|
-
/// Returns the size of the temp file.
|
|
87
|
-
pub fn size(&self) -> io::Result<u64> {
|
|
88
|
-
self.open()?.seek(SeekFrom::End(0))
|
|
89
|
-
}
|
|
90
86
|
}
|
|
91
87
|
|
|
92
88
|
impl Drop for TempFile {
|
|
@@ -5,7 +5,7 @@ use std::time::Instant;
|
|
|
5
5
|
|
|
6
6
|
use crate::utils::logging;
|
|
7
7
|
|
|
8
|
-
pub use indicatif::
|
|
8
|
+
pub use indicatif::ProgressStyle;
|
|
9
9
|
|
|
10
10
|
pub fn is_progress_bar_visible() -> bool {
|
|
11
11
|
env::var("SENTRY_NO_PROGRESS_BAR") != Ok("1".into())
|
|
@@ -37,16 +37,6 @@ impl ProgressBar {
|
|
|
37
37
|
indicatif::ProgressBar::hidden().into()
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
-
pub fn finish(&self) {
|
|
41
|
-
self.inner.finish();
|
|
42
|
-
logging::set_progress_bar(None);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
pub fn finish_with_message(&self, msg: &str) {
|
|
46
|
-
self.inner.finish_with_message(msg);
|
|
47
|
-
logging::set_progress_bar(None);
|
|
48
|
-
}
|
|
49
|
-
|
|
50
40
|
pub fn finish_with_duration(&self, op: &str) {
|
|
51
41
|
let dur = self.start.elapsed();
|
|
52
42
|
// We could use `dur.as_secs_f64()`, but its unnecessarily precise (micros). Millis are enough for our purpose.
|
|
@@ -1,65 +1,19 @@
|
|
|
1
1
|
use std::borrow::Cow;
|
|
2
2
|
use std::env;
|
|
3
|
+
#[cfg(target_os = "macos")]
|
|
3
4
|
use std::process;
|
|
4
5
|
|
|
5
6
|
use anyhow::{Error, Result};
|
|
6
7
|
use console::style;
|
|
8
|
+
use dotenv::Result as DotenvResult;
|
|
7
9
|
use lazy_static::lazy_static;
|
|
8
10
|
use regex::{Captures, Regex};
|
|
9
11
|
|
|
10
12
|
use crate::config::Config;
|
|
11
|
-
#[cfg(not(windows))]
|
|
12
|
-
use crate::utils::xcode::launched_from_xcode;
|
|
13
|
-
|
|
14
|
-
#[cfg(not(windows))]
|
|
15
|
-
pub fn run_or_interrupt<F>(f: F)
|
|
16
|
-
where
|
|
17
|
-
F: FnOnce() + Send + 'static,
|
|
18
|
-
{
|
|
19
|
-
// See: https://github.com/getsentry/sentry-cli/pull/1104
|
|
20
|
-
if launched_from_xcode() {
|
|
21
|
-
f();
|
|
22
|
-
return;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
let (tx, rx) = crossbeam_channel::bounded(100);
|
|
26
|
-
let mut signals = signal_hook::iterator::Signals::new([
|
|
27
|
-
signal_hook::consts::SIGTERM,
|
|
28
|
-
signal_hook::consts::SIGINT,
|
|
29
|
-
])
|
|
30
|
-
.unwrap();
|
|
31
|
-
|
|
32
|
-
{
|
|
33
|
-
let tx = tx.clone();
|
|
34
|
-
std::thread::spawn(move || {
|
|
35
|
-
f();
|
|
36
|
-
tx.send(0).ok();
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
13
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
}
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
if let Ok(signal) = rx.recv() {
|
|
47
|
-
if signal == signal_hook::consts::SIGINT {
|
|
48
|
-
eprintln!("Interrupted!");
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
#[cfg(windows)]
|
|
54
|
-
pub fn run_or_interrupt<F>(f: F)
|
|
55
|
-
where
|
|
56
|
-
F: FnOnce(),
|
|
57
|
-
F: Send + 'static,
|
|
58
|
-
{
|
|
59
|
-
f();
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
/// Propagate an exit status outwarts
|
|
14
|
+
/// Propagate an exit status outwarts.
|
|
15
|
+
/// We only use this function in the macOS binary.
|
|
16
|
+
#[cfg(target_os = "macos")]
|
|
63
17
|
pub fn propagate_exit_status(status: process::ExitStatus) {
|
|
64
18
|
if !status.success() {
|
|
65
19
|
if let Some(code) = status.code() {
|
|
@@ -177,15 +131,28 @@ pub fn init_backtrace() {
|
|
|
177
131
|
pub struct QuietExit(pub i32);
|
|
178
132
|
|
|
179
133
|
/// Loads a .env file
|
|
180
|
-
pub fn load_dotenv() {
|
|
181
|
-
|
|
182
|
-
.map(|x| x.as_str()
|
|
183
|
-
.unwrap_or(
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
} else {
|
|
188
|
-
dotenv::dotenv().ok();
|
|
189
|
-
}
|
|
134
|
+
pub fn load_dotenv() -> DotenvResult<()> {
|
|
135
|
+
let load_dotenv_unset = env::var("SENTRY_LOAD_DOTENV")
|
|
136
|
+
.map(|x| x.as_str() != "1")
|
|
137
|
+
.unwrap_or(false);
|
|
138
|
+
|
|
139
|
+
if load_dotenv_unset {
|
|
140
|
+
return Ok(());
|
|
190
141
|
}
|
|
142
|
+
|
|
143
|
+
match env::var("SENTRY_DOTENV_PATH") {
|
|
144
|
+
Ok(path) => dotenv::from_path(path),
|
|
145
|
+
Err(_) => dotenv::dotenv().map(|_| ()),
|
|
146
|
+
}
|
|
147
|
+
.map_or_else(
|
|
148
|
+
|error| {
|
|
149
|
+
// We only propogate errors if the .env file was found and failed to load.
|
|
150
|
+
if error.not_found() {
|
|
151
|
+
Ok(())
|
|
152
|
+
} else {
|
|
153
|
+
Err(error)
|
|
154
|
+
}
|
|
155
|
+
},
|
|
156
|
+
|_| Ok(()),
|
|
157
|
+
)
|
|
191
158
|
}
|
|
@@ -21,7 +21,9 @@ use {
|
|
|
21
21
|
unix_daemonize::{daemonize_redirect, ChdirMode},
|
|
22
22
|
};
|
|
23
23
|
|
|
24
|
-
use crate::utils::fs::
|
|
24
|
+
use crate::utils::fs::SeekRead;
|
|
25
|
+
#[cfg(target_os = "macos")]
|
|
26
|
+
use crate::utils::fs::TempFile;
|
|
25
27
|
use crate::utils::system::expand_vars;
|
|
26
28
|
|
|
27
29
|
#[derive(Deserialize, Debug)]
|
|
@@ -359,6 +361,7 @@ impl InfoPlist {
|
|
|
359
361
|
&self.version
|
|
360
362
|
}
|
|
361
363
|
|
|
364
|
+
#[cfg(target_os = "macos")] // only used in macOS binary
|
|
362
365
|
pub fn build(&self) -> &str {
|
|
363
366
|
&self.build
|
|
364
367
|
}
|
|
@@ -376,6 +379,7 @@ impl InfoPlist {
|
|
|
376
379
|
/// the xcode console and continue in the background. This becomes
|
|
377
380
|
/// a dummy shim for non xcode runs or platforms.
|
|
378
381
|
pub struct MayDetach<'a> {
|
|
382
|
+
#[cfg(target_os = "macos")] // only used in macOS binary
|
|
379
383
|
output_file: Option<TempFile>,
|
|
380
384
|
#[allow(dead_code)]
|
|
381
385
|
task_name: &'a str,
|
|
@@ -383,13 +387,20 @@ pub struct MayDetach<'a> {
|
|
|
383
387
|
|
|
384
388
|
impl<'a> MayDetach<'a> {
|
|
385
389
|
fn new(task_name: &'a str) -> MayDetach<'a> {
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
390
|
+
#[cfg(target_os = "macos")]
|
|
391
|
+
{
|
|
392
|
+
MayDetach {
|
|
393
|
+
output_file: None,
|
|
394
|
+
task_name,
|
|
395
|
+
}
|
|
389
396
|
}
|
|
397
|
+
|
|
398
|
+
#[cfg(not(target_os = "macos"))]
|
|
399
|
+
MayDetach { task_name }
|
|
390
400
|
}
|
|
391
401
|
|
|
392
|
-
/// Returns true if we are deteached from xcode
|
|
402
|
+
/// Returns true if we are deteached from xcode.
|
|
403
|
+
#[cfg(target_os = "macos")]
|
|
393
404
|
pub fn is_detached(&self) -> bool {
|
|
394
405
|
self.output_file.is_some()
|
|
395
406
|
}
|
|
@@ -502,12 +513,6 @@ pub fn launched_from_xcode() -> bool {
|
|
|
502
513
|
false
|
|
503
514
|
}
|
|
504
515
|
|
|
505
|
-
/// Returns true if we were invoked from xcode
|
|
506
|
-
#[cfg(not(target_os = "macos"))]
|
|
507
|
-
pub fn launched_from_xcode() -> bool {
|
|
508
|
-
false
|
|
509
|
-
}
|
|
510
|
-
|
|
511
516
|
/// Shows a dialog in xcode and blocks. The dialog will have a title and a
|
|
512
517
|
/// message as well as the buttons "Show details" and "Ignore". Returns
|
|
513
518
|
/// `true` if the `show details` button has been pressed.
|
|
@@ -1,140 +0,0 @@
|
|
|
1
|
-
use std::env;
|
|
2
|
-
use std::io;
|
|
3
|
-
use std::path::Path;
|
|
4
|
-
use std::process;
|
|
5
|
-
use std::str;
|
|
6
|
-
|
|
7
|
-
use anyhow::{bail, format_err, Error, Result};
|
|
8
|
-
use console::strip_ansi_codes;
|
|
9
|
-
use glob::{glob_with, MatchOptions};
|
|
10
|
-
use if_chain::if_chain;
|
|
11
|
-
use serde::Deserialize;
|
|
12
|
-
|
|
13
|
-
use crate::utils::releases::{get_xcode_release_name, infer_gradle_release_name};
|
|
14
|
-
use crate::utils::xcode::{InfoPlist, XcodeProjectInfo};
|
|
15
|
-
|
|
16
|
-
#[cfg(not(windows))]
|
|
17
|
-
static CODEPUSH_BIN_PATH: &str = "code-push";
|
|
18
|
-
#[cfg(not(windows))]
|
|
19
|
-
static CODEPUSH_NPM_PATH: &str = "node_modules/.bin/code-push";
|
|
20
|
-
|
|
21
|
-
#[cfg(windows)]
|
|
22
|
-
static CODEPUSH_BIN_PATH: &str = "code-push.cmd";
|
|
23
|
-
#[cfg(windows)]
|
|
24
|
-
static CODEPUSH_NPM_PATH: &str = "node_modules/.bin/code-push.cmd";
|
|
25
|
-
|
|
26
|
-
#[derive(Debug, Deserialize)]
|
|
27
|
-
pub struct CodePushPackage {
|
|
28
|
-
pub label: String,
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
#[derive(Debug, Deserialize)]
|
|
32
|
-
pub struct CodePushDeployment {
|
|
33
|
-
pub name: String,
|
|
34
|
-
pub package: Option<CodePushPackage>,
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
fn get_codepush_error(output: &process::Output) -> Error {
|
|
38
|
-
if let Ok(message) = str::from_utf8(&output.stderr) {
|
|
39
|
-
let stripped = strip_ansi_codes(message);
|
|
40
|
-
format_err!(if let Some(rest) = stripped.strip_prefix("[Error] ") {
|
|
41
|
-
rest
|
|
42
|
-
} else if let Some(rest) = stripped.strip_prefix("[Error] ") {
|
|
43
|
-
rest
|
|
44
|
-
} else {
|
|
45
|
-
&stripped
|
|
46
|
-
}
|
|
47
|
-
.to_string(),)
|
|
48
|
-
} else {
|
|
49
|
-
format_err!("Unknown Error")
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
pub fn get_codepush_deployments(app: &str) -> Result<Vec<CodePushDeployment>> {
|
|
54
|
-
let codepush_bin = if Path::new(CODEPUSH_NPM_PATH).exists() {
|
|
55
|
-
CODEPUSH_NPM_PATH
|
|
56
|
-
} else {
|
|
57
|
-
CODEPUSH_BIN_PATH
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
let output = process::Command::new(codepush_bin)
|
|
61
|
-
.arg("deployment")
|
|
62
|
-
.arg("ls")
|
|
63
|
-
.arg(app)
|
|
64
|
-
.arg("--format")
|
|
65
|
-
.arg("json")
|
|
66
|
-
.output()
|
|
67
|
-
.map_err(|e| {
|
|
68
|
-
if e.kind() == io::ErrorKind::NotFound {
|
|
69
|
-
Error::msg("Codepush not found. Is it installed and configured on the PATH?")
|
|
70
|
-
} else {
|
|
71
|
-
Error::from(e).context("Failed to run codepush")
|
|
72
|
-
}
|
|
73
|
-
})?;
|
|
74
|
-
|
|
75
|
-
if output.status.success() {
|
|
76
|
-
Ok(serde_json::from_slice(&output.stdout).unwrap_or_else(|_| {
|
|
77
|
-
let format_err = format!("Command `{codepush_bin} deployment ls {app} --format json` failed to produce a valid JSON output.");
|
|
78
|
-
panic!("{}", format_err);
|
|
79
|
-
}))
|
|
80
|
-
} else {
|
|
81
|
-
Err(get_codepush_error(&output).context("Failed to get codepush deployments"))
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
pub fn get_codepush_package(app: &str, deployment: &str) -> Result<CodePushPackage> {
|
|
86
|
-
let deployments = get_codepush_deployments(app)?;
|
|
87
|
-
for dep in deployments {
|
|
88
|
-
if_chain! {
|
|
89
|
-
if dep.name == deployment;
|
|
90
|
-
if let Some(pkg) = dep.package;
|
|
91
|
-
then {
|
|
92
|
-
return Ok(pkg);
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
bail!("Could not find deployment {} for {}", deployment, app)
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
pub fn get_react_native_codepush_release(
|
|
101
|
-
package: &CodePushPackage,
|
|
102
|
-
platform: &str,
|
|
103
|
-
bundle_id_override: Option<&str>,
|
|
104
|
-
) -> Result<String> {
|
|
105
|
-
if let Some(bundle_id) = bundle_id_override {
|
|
106
|
-
return Ok(format!("{}+codepush:{}", bundle_id, package.label));
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
if platform == "ios" {
|
|
110
|
-
if !cfg!(target_os = "macos") {
|
|
111
|
-
bail!("Codepush releases for iOS require OS X if no bundle ID is specified");
|
|
112
|
-
}
|
|
113
|
-
let mut opts = MatchOptions::new();
|
|
114
|
-
opts.case_sensitive = false;
|
|
115
|
-
for entry in (glob_with("ios/*.xcodeproj", opts)?).flatten() {
|
|
116
|
-
let pi = XcodeProjectInfo::from_path(entry)?;
|
|
117
|
-
if let Some(ipl) = InfoPlist::from_project_info(&pi)? {
|
|
118
|
-
if let Some(release_name) = get_xcode_release_name(Some(ipl))? {
|
|
119
|
-
return Ok(format!("{}+codepush:{}", release_name, package.label));
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
bail!("Could not find plist");
|
|
124
|
-
} else if platform == "android" {
|
|
125
|
-
if_chain! {
|
|
126
|
-
if let Ok(here) = env::current_dir();
|
|
127
|
-
if let Ok(android_folder) = here.join("android").metadata();
|
|
128
|
-
if android_folder.is_dir();
|
|
129
|
-
then {
|
|
130
|
-
if let Some(release_name) = infer_gradle_release_name(Some(here.join("android")))? {
|
|
131
|
-
return Ok(format!("{}+codepush:{}", release_name, package.label));
|
|
132
|
-
} else {
|
|
133
|
-
bail!("Could not parse app id from build.gradle");
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
bail!("Could not find AndroidManifest.xml");
|
|
138
|
-
}
|
|
139
|
-
bail!("Unsupported platform '{}'", platform);
|
|
140
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
use std::borrow::Cow;
|
|
2
|
-
use std::str;
|
|
3
|
-
|
|
4
|
-
use anyhow::Result;
|
|
5
|
-
use chardet::detect;
|
|
6
|
-
use encoding::label::encoding_from_whatwg_label;
|
|
7
|
-
use encoding::DecoderTrap;
|
|
8
|
-
use if_chain::if_chain;
|
|
9
|
-
|
|
10
|
-
#[derive(thiserror::Error, Debug)]
|
|
11
|
-
#[error("unknown encoding for string")]
|
|
12
|
-
pub struct UnknownEncodingError;
|
|
13
|
-
|
|
14
|
-
// Decodes bytes from an unknown encoding
|
|
15
|
-
pub fn decode_unknown_string(bytes: &[u8]) -> Result<Cow<'_, str>> {
|
|
16
|
-
if let Ok(s) = str::from_utf8(bytes) {
|
|
17
|
-
Ok(Cow::Borrowed(s))
|
|
18
|
-
} else {
|
|
19
|
-
let (label, confidence, _) = detect(bytes);
|
|
20
|
-
if_chain! {
|
|
21
|
-
if confidence >= 0.5;
|
|
22
|
-
if let Some(enc) = encoding_from_whatwg_label(&label);
|
|
23
|
-
if let Ok(s) = enc.decode(bytes, DecoderTrap::Replace);
|
|
24
|
-
then {
|
|
25
|
-
Ok(Cow::Owned(s))
|
|
26
|
-
} else {
|
|
27
|
-
Err(UnknownEncodingError.into())
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|