diff --git a/.gitignore b/.gitignore index f6c313c..a727c0a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ /target -/data \ No newline at end of file +/data diff --git a/docker-compose.example.yml b/docker-compose.example.yml index d12974f..c991e2c 100644 --- a/docker-compose.example.yml +++ b/docker-compose.example.yml @@ -1,6 +1,6 @@ services: postgres: - image: 'docker.io/library/postgres:17-alpine' + image: "docker.io/library/postgres:17-alpine" environment: - POSTGRES_PASSWORD=ReplaceMeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee # if there's already a he/him gregory down the hall, then change it to `gregory_it_its`, to make sure you know it's gregory, the program, not gregory the he/him down the hall @@ -9,6 +9,6 @@ services: - POSTGRES_USER=gregory - POSTGRES_DB=gregory volumes: - - './data:/var/lib/postgresql/data' + - "./data:/var/lib/postgresql/data" ports: - 9001:5432 diff --git a/docs/behind-the-scenes/commands.md b/docs/behind-the-scenes/commands.md index 674e5d9..7091f82 100644 --- a/docs/behind-the-scenes/commands.md +++ b/docs/behind-the-scenes/commands.md @@ -1,3 +1,3 @@ # How commands are run -I was unable to find a way to directly run *multiple* commands via Docker/Podman. Instead of doing that, greg puts all the commands in a temporary script, mounts it inside, and then run it with \ No newline at end of file +I was unable to find a way to directly run *multiple* commands via Docker/Podman. Instead of doing that, greg puts all the commands in a temporary script, mounts it inside, and then run it with diff --git a/gregory.example.toml b/gregory.example.toml index 86e58dc..b36e84f 100644 --- a/gregory.example.toml +++ b/gregory.example.toml @@ -5,7 +5,7 @@ max-threads = 10 [packages.librewolf] - dependencies = ["some-librewolf-dependency"] + dependencies = ["some-librewolf-dependency"] [packages.librewolf.compilation] id = "1" @@ -53,4 +53,4 @@ max-threads = 10 [volumes] librewolf = "./data/librewolf:/librewolf" other-workspace = "./data/other-workspace:/workspace" -fedora-repo = "./data/fedora-repo:/fedora-repo" \ No newline at end of file +fedora-repo = "./data/fedora-repo:/fedora-repo" diff --git a/src/data.rs b/src/data.rs index c0209ff..d8e21b7 100644 --- a/src/data.rs +++ b/src/data.rs @@ -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(); -} \ No newline at end of file +} diff --git a/src/logging.rs b/src/logging.rs index bffd5e0..9865b23 100644 --- a/src/logging.rs +++ b/src/logging.rs @@ -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 { } } } - -} \ No newline at end of file +} diff --git a/src/main.rs b/src/main.rs index adb2ed8..629e3dd 100644 --- a/src/main.rs +++ b/src/main.rs @@ -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 diff --git a/src/tests.rs b/src/tests.rs index ddff2dd..bb45895 100644 --- a/src/tests.rs +++ b/src/tests.rs @@ -1,4 +1,3 @@ -use crate::data; #[cfg(test)] use alphanumeric_sort::sort_str_slice;