deploy 2.0.0-dev-79

This commit is contained in:
mbecker20
2025-10-27 00:38:08 -07:00
parent df97ced7a4
commit 0a890078b0
5 changed files with 61 additions and 35 deletions

40
Cargo.lock generated
View File

@@ -902,7 +902,7 @@ dependencies = [
[[package]]
name = "cache"
version = "2.0.0-dev-78"
version = "2.0.0-dev-79"
dependencies = [
"anyhow",
"tokio",
@@ -1094,7 +1094,7 @@ dependencies = [
[[package]]
name = "command"
version = "2.0.0-dev-78"
version = "2.0.0-dev-79"
dependencies = [
"komodo_client",
"shlex",
@@ -1121,7 +1121,7 @@ checksum = "e47641d3deaf41fb1538ac1f54735925e275eaf3bf4d55c81b137fba797e5cbb"
[[package]]
name = "config"
version = "2.0.0-dev-78"
version = "2.0.0-dev-79"
dependencies = [
"colored",
"indexmap 2.12.0",
@@ -1443,7 +1443,7 @@ checksum = "2a2330da5de22e8a3cb63252ce2abb30116bf5265e89c0e01bc17015ce30a476"
[[package]]
name = "database"
version = "2.0.0-dev-78"
version = "2.0.0-dev-79"
dependencies = [
"anyhow",
"async-compression",
@@ -1742,7 +1742,7 @@ dependencies = [
[[package]]
name = "encoding"
version = "2.0.0-dev-78"
version = "2.0.0-dev-79"
dependencies = [
"anyhow",
"bytes",
@@ -1784,7 +1784,7 @@ dependencies = [
[[package]]
name = "environment"
version = "2.0.0-dev-78"
version = "2.0.0-dev-79"
dependencies = [
"anyhow",
"formatting",
@@ -1794,7 +1794,7 @@ dependencies = [
[[package]]
name = "environment_file"
version = "2.0.0-dev-78"
version = "2.0.0-dev-79"
dependencies = [
"thiserror 2.0.17",
]
@@ -1890,7 +1890,7 @@ dependencies = [
[[package]]
name = "formatting"
version = "2.0.0-dev-78"
version = "2.0.0-dev-79"
dependencies = [
"serror",
]
@@ -2056,7 +2056,7 @@ dependencies = [
[[package]]
name = "git"
version = "2.0.0-dev-78"
version = "2.0.0-dev-79"
dependencies = [
"anyhow",
"cache",
@@ -2688,7 +2688,7 @@ dependencies = [
[[package]]
name = "interpolate"
version = "2.0.0-dev-78"
version = "2.0.0-dev-79"
dependencies = [
"anyhow",
"komodo_client",
@@ -2810,7 +2810,7 @@ dependencies = [
[[package]]
name = "komodo_cli"
version = "2.0.0-dev-78"
version = "2.0.0-dev-79"
dependencies = [
"anyhow",
"bytes",
@@ -2840,7 +2840,7 @@ dependencies = [
[[package]]
name = "komodo_client"
version = "2.0.0-dev-78"
version = "2.0.0-dev-79"
dependencies = [
"anyhow",
"async_timing_util",
@@ -2875,7 +2875,7 @@ dependencies = [
[[package]]
name = "komodo_core"
version = "2.0.0-dev-78"
version = "2.0.0-dev-79"
dependencies = [
"anyhow",
"arc-swap",
@@ -2949,7 +2949,7 @@ dependencies = [
[[package]]
name = "komodo_periphery"
version = "2.0.0-dev-78"
version = "2.0.0-dev-79"
dependencies = [
"anyhow",
"arc-swap",
@@ -3069,7 +3069,7 @@ checksum = "34080505efa8e45a4b816c349525ebe327ceaa8559756f0356cba97ef3bf7432"
[[package]]
name = "logger"
version = "2.0.0-dev-78"
version = "2.0.0-dev-79"
dependencies = [
"anyhow",
"komodo_client",
@@ -3361,7 +3361,7 @@ dependencies = [
[[package]]
name = "noise"
version = "2.0.0-dev-78"
version = "2.0.0-dev-79"
dependencies = [
"anyhow",
"arc-swap",
@@ -3776,7 +3776,7 @@ checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220"
[[package]]
name = "periphery_client"
version = "2.0.0-dev-78"
version = "2.0.0-dev-79"
dependencies = [
"anyhow",
"derive_variants",
@@ -4257,7 +4257,7 @@ dependencies = [
[[package]]
name = "response"
version = "2.0.0-dev-78"
version = "2.0.0-dev-79"
dependencies = [
"anyhow",
"axum",
@@ -4527,7 +4527,7 @@ dependencies = [
[[package]]
name = "secret_file"
version = "2.0.0-dev-78"
version = "2.0.0-dev-79"
dependencies = [
"tokio",
]
@@ -5560,7 +5560,7 @@ dependencies = [
[[package]]
name = "transport"
version = "2.0.0-dev-78"
version = "2.0.0-dev-79"
dependencies = [
"anyhow",
"axum",

View File

@@ -8,7 +8,7 @@ members = [
]
[workspace.package]
version = "2.0.0-dev-78"
version = "2.0.0-dev-79"
edition = "2024"
authors = ["mbecker20 <becker.maxh@gmail.com>"]
license = "GPL-3.0-or-later"

View File

@@ -134,25 +134,40 @@ pub async fn run_standard_command(
{
lexed
} else {
return CommandOutput::from(Err(std::io::Error::other(
"Command lexed into empty args",
)));
return CommandOutput::from_err(
std::io::Error::other("Command lexed into empty args"),
None,
);
};
let mut cmd = Command::new(&lexed[0]);
cmd
.args(&lexed[1..])
.kill_on_drop(true)
.stdin(Stdio::null());
.stdin(Stdio::null())
.stdout(Stdio::piped())
.stderr(Stdio::piped());
if let Some(path) = path.into() {
match path.canonicalize() {
Ok(path) => {
cmd.current_dir(path);
}
Err(e) => return CommandOutput::from(Err(e)),
Err(e) => return CommandOutput::from(Err(e), None),
}
}
let output = cmd.output().await;
CommandOutput::from(output)
let child = match cmd.spawn() {
Ok(child) => child,
Err(e) => return CommandOutput::from_err(e, None),
};
let pid = child.id();
println!("[{}] {command}", pid.clone().unwrap_or_default());
CommandOutput::from(child.wait_with_output().await, pid)
}
fn shell() -> &'static str {
@@ -174,18 +189,27 @@ pub async fn run_shell_command(
path: impl Into<Option<&Path>>,
) -> CommandOutput {
let mut cmd = Command::new(shell());
cmd
.args(["-c", command])
.kill_on_drop(true)
.stdin(Stdio::null());
if let Some(path) = path.into() {
match path.canonicalize() {
Ok(path) => {
cmd.current_dir(path);
}
Err(e) => return CommandOutput::from(Err(e)),
Err(e) => return CommandOutput::from(Err(e), None),
}
}
let output = cmd.output().await;
CommandOutput::from(output)
let child = match cmd.spawn() {
Ok(child) => child,
Err(e) => return CommandOutput::from_err(e, None),
};
let pid = child.id();
CommandOutput::from(child.wait_with_output().await, pid)
}

View File

@@ -6,27 +6,30 @@ use std::{
#[derive(Debug, Clone)]
pub struct CommandOutput {
pub pid: Option<u32>,
pub status: ExitStatus,
pub stdout: String,
pub stderr: String,
}
impl CommandOutput {
pub fn from(output: io::Result<Output>) -> Self {
pub fn from(output: io::Result<Output>, pid: Option<u32>) -> Self {
match output {
Ok(output) => Self {
pid,
status: output.status,
stdout: String::from_utf8(output.stdout)
.unwrap_or("failed to generate stdout".to_string()),
stderr: String::from_utf8(output.stderr)
.unwrap_or("failed to generate stderr".to_string()),
},
Err(e) => CommandOutput::from_err(e),
Err(e) => CommandOutput::from_err(e, pid),
}
}
pub fn from_err(e: io::Error) -> Self {
pub fn from_err(e: io::Error, pid: Option<u32>) -> Self {
Self {
pid,
status: ExitStatus::from_raw(1),
stdout: "".to_string(),
stderr: format!("{e:#?}"),

View File

@@ -12,7 +12,6 @@ pub async fn init_folder_as_repo(
access_token: Option<&str>,
logs: &mut Vec<Log>,
) {
// let folder_path = args.path(repo_dir);
// Initialize the folder as a git repo
let init_repo =
run_komodo_standard_command("Git Init", folder_path, "git init")