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
2 changes: 1 addition & 1 deletion src/bashsupport.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ _sentry_err_trap() {
echo "@exit_code:${_exit_code}" >> "$_SENTRY_TRACEBACK_FILE"

: >> "$_SENTRY_LOG_FILE"
export SENTRY_LAST_EVENT=$("___SENTRY_CLI___" bash-hook --send-event --traceback "$_SENTRY_TRACEBACK_FILE" --log "$_SENTRY_LOG_FILE" ___SENTRY_NO_ENVIRON___)
export SENTRY_LAST_EVENT=$(___SENTRY_CLI___ bash-hook --send-event --traceback "$_SENTRY_TRACEBACK_FILE" --log "$_SENTRY_LOG_FILE" ___SENTRY_NO_ENVIRON___)
rm -f "$_SENTRY_TRACEBACK_FILE" "$_SENTRY_LOG_FILE"
}

Expand Down
17 changes: 14 additions & 3 deletions src/commands/bash_hook.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@ pub fn make_app<'a, 'b: 'a>(app: App<'a, 'b>) -> App<'a, 'b> {
.long("no-environ")
.help("Do not send environment variables along"),
)
.arg(
Arg::with_name("cli")
.long("cli")
.value_name("CMD")
.help("Explicitly set/override the sentry-cli command"),
)
.arg(
Arg::with_name("send_event")
.long("send-event")
Expand Down Expand Up @@ -186,11 +192,16 @@ pub fn execute<'a>(matches: &ArgMatches<'a>) -> Result<(), Error> {
"___SENTRY_TRACEBACK_FILE___",
&traceback.display().to_string(),
)
.replace("___SENTRY_LOG_FILE___", &log.display().to_string())
.replace(
"___SENTRY_CLI___",
.replace("___SENTRY_LOG_FILE___", &log.display().to_string());

if matches.is_present("cli") {
script = script.replace("___SENTRY_CLI___", matches.value_of("cli").unwrap());
} else {
script = script.replace(
"__SENTRY_CLI__",
&env::current_exe().unwrap().display().to_string(),
);
}

if matches.is_present("no_environ") {
script = script.replace("___SENTRY_NO_ENVIRON___", "--no-environ");
Expand Down