feat: add basic error handling
Add anyhow::Result<()> return signature to all scripts and main.
This commit is contained in:
@@ -1,34 +1,35 @@
|
||||
use super::DockerCommand;
|
||||
use anyhow::Result;
|
||||
|
||||
// simple commands
|
||||
pub fn build() {
|
||||
DockerCommand::docker_compose().args("build").spawn_wait();
|
||||
pub fn build() -> Result<()> {
|
||||
DockerCommand::docker_compose().args("build").spawn_wait()
|
||||
}
|
||||
|
||||
pub fn down() {
|
||||
DockerCommand::docker_compose().args("down").spawn_wait();
|
||||
pub fn down() -> Result<()> {
|
||||
DockerCommand::docker_compose().args("down").spawn_wait()
|
||||
}
|
||||
|
||||
pub fn start() {
|
||||
DockerCommand::docker_compose().args("start").spawn_wait();
|
||||
pub fn start() -> Result<()> {
|
||||
DockerCommand::docker_compose().args("start").spawn_wait()
|
||||
}
|
||||
|
||||
pub fn stop() {
|
||||
DockerCommand::docker_compose().args("stop").spawn_wait();
|
||||
pub fn stop() -> Result<()> {
|
||||
DockerCommand::docker_compose().args("stop").spawn_wait()
|
||||
}
|
||||
|
||||
pub fn up() {
|
||||
DockerCommand::docker_compose().args("up -d").spawn_wait();
|
||||
pub fn up() -> Result<()> {
|
||||
DockerCommand::docker_compose().args("up -d").spawn_wait()
|
||||
}
|
||||
|
||||
// shortcuts
|
||||
pub fn rebuild() {
|
||||
stop();
|
||||
build();
|
||||
start();
|
||||
pub fn rebuild() -> Result<()> {
|
||||
stop()?;
|
||||
build()?;
|
||||
start()
|
||||
}
|
||||
|
||||
pub fn restart() {
|
||||
stop();
|
||||
start();
|
||||
pub fn restart() -> Result<()> {
|
||||
stop()?;
|
||||
start()
|
||||
}
|
||||
|
Reference in New Issue
Block a user