feat: build commands from arguments instead of strings
This commit is contained in:
@@ -4,7 +4,6 @@ use std::path::{Path, PathBuf};
|
||||
|
||||
use anyhow::{Result, anyhow};
|
||||
|
||||
use crate::command_builder::CommandBuilder;
|
||||
use crate::compose::Compose;
|
||||
use crate::scripts::docker_compose;
|
||||
use crate::{create_file, safe_create_file};
|
||||
@@ -65,10 +64,10 @@ pub fn run(rest: &[String]) -> Result<()> {
|
||||
}
|
||||
|
||||
pub fn manage(rest: &[String]) -> Result<()> {
|
||||
let container = Compose::resolve()?.django()?;
|
||||
let joined = rest.join(" ");
|
||||
let command = format!("run --rm {container} python manage.py {joined}");
|
||||
CommandBuilder::docker_compose().args(&command).exec()
|
||||
let mut args = vec!["python".to_string(), "manage.py".to_string()];
|
||||
args.extend_from_slice(rest);
|
||||
|
||||
run(&args)
|
||||
}
|
||||
|
||||
// shortcuts
|
||||
|
||||
Reference in New Issue
Block a user