From 790be08959e44d639c2fad1df94bab913155d30b Mon Sep 17 00:00:00 2001 From: ReeseHatfield Date: Sun, 30 Aug 2026 21:00:00 -0400 Subject: [PATCH 1/6] add update subcommand --- src/bin/oseda.rs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/bin/oseda.rs b/src/bin/oseda.rs index 330bbd1..47a0a7c 100644 --- a/src/bin/oseda.rs +++ b/src/bin/oseda.rs @@ -2,14 +2,13 @@ use std::{error::Error, process}; use clap::Parser; use oseda_cli::{ - cmd::{ + Cli, Commands, cmd::{ check, deploy::{self}, export::{self}, fork::{self}, - init, run, - }, - Cli, Commands, + init, run, update, + } }; /// CLI entry point @@ -34,6 +33,11 @@ fn main() { Commands::Fork => fork::fork(), Commands::Export(options) => export::export(options.clone()) .map(|_| println!("Successfully export project to {0}", options.port)), + Commands::Update => update::update() + .map(|_| { + println!("Successfully updated oseda"); + println!("You may need to restart the shell for updates to take effect") + }), }; // little annoying, but makes the exit code match what users would expect From 87d29bb8bdfd4419994d0827c07f4e2864582452 Mon Sep 17 00:00:00 2001 From: ReeseHatfield Date: Sun, 30 Aug 2026 21:00:21 -0400 Subject: [PATCH 2/6] add update subcommand --- src/cmd/mod.rs | 1 + src/lib.rs | 2 ++ 2 files changed, 3 insertions(+) diff --git a/src/cmd/mod.rs b/src/cmd/mod.rs index d63b2d2..6e5f42c 100644 --- a/src/cmd/mod.rs +++ b/src/cmd/mod.rs @@ -4,3 +4,4 @@ pub mod export; pub mod fork; pub mod init; pub mod run; +pub mod update; \ No newline at end of file diff --git a/src/lib.rs b/src/lib.rs index 1ffca8b..ddb94b3 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -38,4 +38,6 @@ pub enum Commands { /// This will install the npm package `decktape` /// This relies on a chromium backend, as a result, it may take a while to run Export(cmd::export::ExportOptions), + /// Update the oseda binary from crates.io + Update, } From d690039cd55239e01accc03bc55ea42e0f017770 Mon Sep 17 00:00:00 2001 From: ReeseHatfield Date: Sun, 30 Aug 2026 21:00:47 -0400 Subject: [PATCH 3/6] add cargo install oseda-cli logic --- src/cmd/update.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 src/cmd/update.rs diff --git a/src/cmd/update.rs b/src/cmd/update.rs new file mode 100644 index 0000000..8243e0d --- /dev/null +++ b/src/cmd/update.rs @@ -0,0 +1,15 @@ +use std::{error::Error, process::{Command, Stdio}}; + +pub fn update() -> Result<(), Box>{ + let status = Command::new("cargo") + .args(["install", "oseda-cli"]) + .stdout(Stdio::inherit()) + .stdin(Stdio::inherit()) + .status()?; + + if !status.success() { + return Err(format!("Error: exit status {}", status).into()); + } + + Ok(()) +} \ No newline at end of file From 80bd95f5859b0b55f472e2265824dc7458bd721b Mon Sep 17 00:00:00 2001 From: ReeseHatfield Date: Sun, 30 Aug 2026 21:01:05 -0400 Subject: [PATCH 4/6] clippy --- src/bin/oseda.rs | 14 +++++++------- src/cmd/mod.rs | 2 +- src/cmd/update.rs | 9 ++++++--- 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/src/bin/oseda.rs b/src/bin/oseda.rs index 47a0a7c..e91dd15 100644 --- a/src/bin/oseda.rs +++ b/src/bin/oseda.rs @@ -2,13 +2,14 @@ use std::{error::Error, process}; use clap::Parser; use oseda_cli::{ - Cli, Commands, cmd::{ + cmd::{ check, deploy::{self}, export::{self}, fork::{self}, init, run, update, - } + }, + Cli, Commands, }; /// CLI entry point @@ -33,11 +34,10 @@ fn main() { Commands::Fork => fork::fork(), Commands::Export(options) => export::export(options.clone()) .map(|_| println!("Successfully export project to {0}", options.port)), - Commands::Update => update::update() - .map(|_| { - println!("Successfully updated oseda"); - println!("You may need to restart the shell for updates to take effect") - }), + Commands::Update => update::update().map(|_| { + println!("Successfully updated oseda"); + println!("You may need to restart the shell for updates to take effect") + }), }; // little annoying, but makes the exit code match what users would expect diff --git a/src/cmd/mod.rs b/src/cmd/mod.rs index 6e5f42c..344a04d 100644 --- a/src/cmd/mod.rs +++ b/src/cmd/mod.rs @@ -4,4 +4,4 @@ pub mod export; pub mod fork; pub mod init; pub mod run; -pub mod update; \ No newline at end of file +pub mod update; diff --git a/src/cmd/update.rs b/src/cmd/update.rs index 8243e0d..ad0502f 100644 --- a/src/cmd/update.rs +++ b/src/cmd/update.rs @@ -1,6 +1,9 @@ -use std::{error::Error, process::{Command, Stdio}}; +use std::{ + error::Error, + process::{Command, Stdio}, +}; -pub fn update() -> Result<(), Box>{ +pub fn update() -> Result<(), Box> { let status = Command::new("cargo") .args(["install", "oseda-cli"]) .stdout(Stdio::inherit()) @@ -12,4 +15,4 @@ pub fn update() -> Result<(), Box>{ } Ok(()) -} \ No newline at end of file +} From 375a26d448b0ca3728e7778d26cfff0f6646fbb1 Mon Sep 17 00:00:00 2001 From: ReeseHatfield Date: Sun, 30 Aug 2026 21:01:31 -0400 Subject: [PATCH 5/6] semver --- Cargo.lock | 2 +- Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ef7226c..fa23687 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1059,7 +1059,7 @@ checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" [[package]] name = "oseda-cli" -version = "2.6.2" +version = "2.7.0" dependencies = [ "chrono", "clap", diff --git a/Cargo.toml b/Cargo.toml index a78ffe2..dd042b3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,7 +6,7 @@ homepage = "https://oseda.net" repository = "https://github.com/oseda-dev/oseda-cli" readme = "README.md" name = "oseda-cli" -version = "2.6.2" +version = "2.7.0" edition = "2021" [[bin]] From 8b1c2ef611a6230b6f6ac3bd8091ac224f06932c Mon Sep 17 00:00:00 2001 From: ReeseHatfield Date: Sun, 30 Aug 2026 21:02:24 -0400 Subject: [PATCH 6/6] update usage --- Usage.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Usage.md b/Usage.md index a6b7b3a..0ed32e1 100644 --- a/Usage.md +++ b/Usage.md @@ -11,6 +11,7 @@ This document contains the help content for the `oseda` command-line program. * [`oseda deploy`↴](#oseda-deploy) * [`oseda fork`↴](#oseda-fork) * [`oseda export`↴](#oseda-export) +* [`oseda update`↴](#oseda-update) ## `oseda` @@ -26,6 +27,7 @@ oseda project scafolding CLI * `deploy` — Deploy your Oseda project to github to add to oseda.net * `fork` — Fork the library repository to submit your course * `export` — Export the Oseda project to a PDF file This will install the npm package `decktape` This relies on a chromium backend, as a result, it may take a while to run +* `update` — Update the oseda binary from crates.io @@ -104,6 +106,14 @@ Export the Oseda project to a PDF file This will install the npm package `deckta +## `oseda update` + +Update the oseda binary from crates.io + +**Usage:** `oseda update` + + +