From 72f7b8430dad81293f2ebb88929e45812ff144a5 Mon Sep 17 00:00:00 2001 From: Klesti Selimaj Date: Sun, 12 Jul 2026 05:43:41 -0400 Subject: [PATCH] Fix publish command --- src/main.mist | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/main.mist b/src/main.mist index 6d17160..ad10b72 100644 --- a/src/main.mist +++ b/src/main.mist @@ -16,10 +16,11 @@ void main() process::exit(1); } match args[1].as_str() { - "run" | "build" | "check" | "test" | "publish" | "bench" | "doc" | "fix" | "clippy" | "r" | "b" | "c" => { + "run" | "build" | "check" | "test" | "bench" | "doc" | "fix" | "clippy" | "r" | "b" | "c" => { let mut root = env::current_dir().expect("Unable to find project root"); modify_args(&mut args, &mut root); transpiler::transpile(&root); + println!(""); if builder::build(args, root) { println!("\x1b[32m\nBuild successful\x1b[0m"); @@ -27,6 +28,22 @@ void main() println!("\x1b[31m\nBuild failed\x1b[0m"); } } + "publish" => { + let mut root = env::current_dir().expect("Unable to find project root"); + modify_args(&mut args, &mut root); + transpiler::transpile(&root); + + let status = std::process::Command::new("cargo") + .args(args) + .status() + .expect("Failed to run cargo"); + + if status.success() { + println!("\x1b[32m\nPublished successfully\x1b[0m"); + } else { + println!("\x1b[31m\nFailed to publish\x1b[0m"); + } + } "transpile" | "t" => { let mut root = env::current_dir().expect("Unable to find project root"); modify_args(&mut args, &mut root);