Skip to content

Commit

Permalink
fix error in shell-splitting the handler command
Browse files Browse the repository at this point in the history
  • Loading branch information
kklingenberg committed Mar 19, 2023
1 parent fff39b3 commit cd4585f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 17 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 1 addition & 12 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,19 +1,8 @@
[package]
name = "s3-event-bridge"
version = "0.1.3"
version = "0.1.4"
edition = "2021"

# Starting in Rust 1.62 you can use `cargo add` to add dependencies
# to your project.
#
# If you're using an older Rust version,
# download cargo-edit(https://github.com/killercup/cargo-edit#installation)
# to install the `add` subcommand.
#
# Running `cargo add DEPENDENCY_NAME` will
# add the latest version of a dependency to the list,
# and it will keep the alphabetic ordering for you.

[dependencies]
anyhow = "1.0.69"
aws-config = "0.54.1"
Expand Down
10 changes: 6 additions & 4 deletions src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ use envy::from_env;
use once_cell::sync::OnceCell;
use regex::Regex;
use std::cmp::max;
use std::collections::VecDeque;
use tempfile::TempDir;
use tokio::process::Command;
use tracing::{info, instrument};
Expand All @@ -31,7 +32,7 @@ pub struct App {
pub handler_command_program: String,

/// The arguments passed to the executed handler program.
pub handler_command_args: Vec<String>,
pub handler_command_args: VecDeque<String>,
}

impl App {
Expand Down Expand Up @@ -75,15 +76,16 @@ impl App {
pull_match_key_res.push(Regex::new("")?)
}
// Parse handler command
let mut handler_command_args =
let mut handler_command_args = VecDeque::from(
shell_words::split(&settings.handler_command).with_context(|| {
format!(
"Failed to shell-split handler command {:?}",
&settings.handler_command
)
})?;
})?,
);
let handler_command_program = handler_command_args
.pop()
.pop_front()
.ok_or(anyhow::Error::msg("empty handler command"))?;
// Done
Ok(App {
Expand Down

0 comments on commit cd4585f

Please sign in to comment.