chore: format and clean up code
This commit is contained in:
parent
97cacf0b56
commit
7d5d51f6e1
8 changed files with 12 additions and 22 deletions
|
@ -80,12 +80,12 @@ pub(crate) struct JobExitStatus {
|
|||
/// The [`Job`] this status is from
|
||||
pub(crate) job: Job,
|
||||
/// The status code returned by the command - note that this can be None if the program exits due to a signal like SIGKILL.
|
||||
///
|
||||
///
|
||||
/// This is stored as a u16 rather than a u8 so that 65535 can be returned if there is no exit code rather than doing an Option or something, which I fear will probably come back to haunt me, but whatever
|
||||
/// Update: I knew it. Why did I do this. Anyways this is gonna be an Option<i32> like Command uses now
|
||||
///
|
||||
///
|
||||
/// Hell this isn't even coming back to haunt me for any sane reason, it's because I went with the actually sensible decision of Option<i32> in better-commands, so if I want to use that then I'm stuck using this.
|
||||
///
|
||||
///
|
||||
/// Anyways I'll stop rambling now.
|
||||
pub(crate) exit_code: Option<i32>,
|
||||
/// Where the log is
|
||||
|
@ -174,4 +174,4 @@ pub(crate) fn data() -> String {
|
|||
|
||||
pub(crate) fn dependencies() -> Vec<String> {
|
||||
return Vec::new();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,10 +1,6 @@
|
|||
use crate::errors::Error;
|
||||
use std::fs::{File, OpenOptions};
|
||||
use std::io::Write;
|
||||
use std::sync::{Arc, Mutex};
|
||||
use std::{
|
||||
fs::{File, OpenOptions},
|
||||
os::unix::fs::FileExt,
|
||||
};
|
||||
|
||||
/// The logger for gregory itself - NOT for jobs
|
||||
pub(crate) struct Logger {
|
||||
|
@ -80,5 +76,4 @@ impl JobLogger {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,10 +1,8 @@
|
|||
use crate::cli::*;
|
||||
use crate::data::*;
|
||||
use alphanumeric_sort::sort_str_slice;
|
||||
use better_commands;
|
||||
use clap::{CommandFactory, Parser};
|
||||
use clap_complete::aot::{generate, Bash, Elvish, Fish, PowerShell, Zsh};
|
||||
use std::fs;
|
||||
use std::fs::create_dir_all;
|
||||
use std::fs::remove_dir_all;
|
||||
use std::fs::write;
|
||||
|
@ -15,7 +13,6 @@ use std::path::Path;
|
|||
use std::process::Command;
|
||||
use std::sync::Arc;
|
||||
use std::sync::Mutex;
|
||||
use std::time::Instant;
|
||||
use uuid::Uuid;
|
||||
|
||||
mod cli;
|
||||
|
@ -97,7 +94,6 @@ fn run_job(conf: Config, job: Job) -> JobExitStatus {
|
|||
logging::JobLogger::new(log_path.clone()).unwrap(),
|
||||
));
|
||||
|
||||
|
||||
// write the script
|
||||
let script_path = &format!("{}/tmp/{container_name}.sh", conf.data_dir); // can't select fields in the format!() {} thing, have to do this
|
||||
let script_dir: &Path = Path::new(script_path).parent().unwrap(); // create dir for the script
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
use crate::data;
|
||||
#[cfg(test)]
|
||||
use alphanumeric_sort::sort_str_slice;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue