feat: finish django cli and add aliases

Implemented basic wanted functionality for django subcommands.

Added single or two letter aliases for all subsubcommands.
This commit is contained in:
2023-05-23 22:49:18 +02:00
parent 907740fc5a
commit 286e16e7ce
8 changed files with 112 additions and 19 deletions

View File

@@ -3,7 +3,12 @@ pub mod docker;
pub mod docker_compose;
pub mod postgres;
use std::{ffi::OsStr, process::Command};
use std::{
ffi::OsStr,
fs::{File, OpenOptions},
path::PathBuf,
process::Command,
};
use anyhow::{Context, Result};
@@ -43,3 +48,11 @@ impl DockerCommand {
Ok(())
}
}
fn safe_create_file(path: PathBuf) -> Result<File, std::io::Error> {
OpenOptions::new().write(true).create_new(true).open(path)
}
fn create_file(path: PathBuf) -> Result<File, std::io::Error> {
OpenOptions::new().write(true).create(true).open(path)
}