Skip to content

Commit

Permalink
Move user provided command to args[0]
Browse files Browse the repository at this point in the history
  • Loading branch information
joshwlewis committed Feb 21, 2024
1 parent fabac19 commit 8b2f7f9
Showing 1 changed file with 20 additions and 56 deletions.
76 changes: 20 additions & 56 deletions src/launch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ impl TryFrom<Procfile> for Launch {
launch.processes.push(Process {
r#type: ProcessType::from_str(&key)
.map_err(ProcfileConversionError::InvalidProcessType)?,
command: vec![String::from("bash"), String::from("-c"), value],
args: Vec::<String>::new(),
command: vec![String::from("bash"), String::from("-c")],
args: vec![value],
default: key == "web",
working_directory: WorkingDirectory::App,
});
Expand Down Expand Up @@ -55,12 +55,8 @@ mod test {
launch.processes,
vec![Process {
r#type: process_type!("web"),
command: vec![
String::from("bash"),
String::from("-c"),
String::from("web_command")
],
args: vec![],
command: vec![String::from("bash"), String::from("-c"),],
args: vec![String::from("web_command")],
default: true,
working_directory: WorkingDirectory::App,
}]
Expand All @@ -78,12 +74,8 @@ mod test {
launch.processes,
vec![Process {
r#type: process_type!("xxx"),
command: vec![
String::from("bash"),
String::from("-c"),
String::from("xxx_command")
],
args: vec![],
command: vec![String::from("bash"), String::from("-c"),],
args: vec![String::from("xxx_command")],
default: true,
working_directory: WorkingDirectory::App,
}]
Expand All @@ -103,23 +95,15 @@ mod test {
vec![
Process {
r#type: process_type!("web"),
command: vec![
String::from("bash"),
String::from("-c"),
String::from("web_command")
],
args: vec![],
command: vec![String::from("bash"), String::from("-c"),],
args: vec![String::from("web_command")],
default: true,
working_directory: WorkingDirectory::App,
},
Process {
r#type: process_type!("foo"),
command: vec![
String::from("bash"),
String::from("-c"),
String::from("foo_command")
],
args: vec![],
command: vec![String::from("bash"), String::from("-c"),],
args: vec![String::from("foo_command")],
default: false,
working_directory: WorkingDirectory::App,
}
Expand All @@ -140,23 +124,15 @@ mod test {
vec![
Process {
r#type: process_type!("foo"),
command: vec![
String::from("bash"),
String::from("-c"),
String::from("foo_command")
],
args: vec![],
command: vec![String::from("bash"), String::from("-c"),],
args: vec![String::from("foo_command")],
default: false,
working_directory: WorkingDirectory::App,
},
Process {
r#type: process_type!("bar"),
command: vec![
String::from("bash"),
String::from("-c"),
String::from("bar_command")
],
args: vec![],
command: vec![String::from("bash"), String::from("-c"),],
args: vec![String::from("bar_command")],
default: false,
working_directory: WorkingDirectory::App,
}
Expand Down Expand Up @@ -186,34 +162,22 @@ mod test {
vec![
Process {
r#type: process_type!("aaa"),
command: vec![
String::from("bash"),
String::from("-c"),
String::from("aaa_command")
],
args: vec![],
command: vec![String::from("bash"), String::from("-c"),],
args: vec![String::from("aaa_command")],
default: false,
working_directory: WorkingDirectory::App,
},
Process {
r#type: process_type!("ccc"),
command: vec![
String::from("bash"),
String::from("-c"),
String::from("ccc_command")
],
args: vec![],
command: vec![String::from("bash"), String::from("-c"),],
args: vec![String::from("ccc_command")],
default: false,
working_directory: WorkingDirectory::App,
},
Process {
r#type: process_type!("bbb"),
command: vec![
String::from("bash"),
String::from("-c"),
String::from("bbb_command")
],
args: vec![],
command: vec![String::from("bash"), String::from("-c"),],
args: vec![String::from("bbb_command")],
default: false,
working_directory: WorkingDirectory::App,
},
Expand Down

0 comments on commit 8b2f7f9

Please sign in to comment.