feat: build commands from arguments instead of strings

This commit is contained in:
2026-09-07 13:49:24 +00:00
parent 25f7b7df9d
commit 1bb205bb79
4 changed files with 75 additions and 63 deletions

View File

@@ -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