From 081b5f7248b5c269ff5de58e543d60cf10c6a3d6 Mon Sep 17 00:00:00 2001 From: ReeseHatfield Date: Tue, 25 Aug 2026 14:50:09 -0400 Subject: [PATCH 1/2] add default to PresentationName for slide exporting --- src/cmd/export.rs | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/cmd/export.rs b/src/cmd/export.rs index 55f156c..e8992ed 100644 --- a/src/cmd/export.rs +++ b/src/cmd/export.rs @@ -10,22 +10,32 @@ use std::{ use clap::Args; use crate::{ - cmd::run, - net::kill_port, - puppeteer::{is_puppeteer_chrome_installed, prompt_install_puppeteer_chrome}, + cmd::run, config::read_and_validate_config, net::kill_port, puppeteer::{is_puppeteer_chrome_installed, prompt_install_puppeteer_chrome} }; /// Options struct for the export subcommand #[derive(Args, Debug, Clone)] pub struct ExportOptions { /// String name of the output PDF file - #[arg(long, default_value = "slides.pdf")] + #[arg(long, default_value_t = get_default_output())] pub output: String, /// Port the project runs on #[arg(long, default_value_t = 3000)] pub port: u16, } +fn get_default_output() -> String { + let default = String::from("slides.pdf"); + + let Ok(config) = read_and_validate_config() else { + println!("Warning: Could not read oseda-config.json"); + println!("Using slides.pdf as name instead"); + return default; + }; + + return format!("{}.pdf", config.title.trim()); +} + /// Export the current Oseda project to a PDF file via `decktape` pub fn export(opts: ExportOptions) -> Result<(), Box> { println!("Cleaning any existing oseda processing..."); From 1beec764a2cc5092f74a1b228f3b880d29961765 Mon Sep 17 00:00:00 2001 From: ReeseHatfield Date: Tue, 25 Aug 2026 14:58:21 -0400 Subject: [PATCH 2/2] add course name to default commit message --- src/cmd/deploy.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/cmd/deploy.rs b/src/cmd/deploy.rs index 9cb52ed..5a1ac20 100644 --- a/src/cmd/deploy.rs +++ b/src/cmd/deploy.rs @@ -84,11 +84,12 @@ pub fn deploy(opts: DeployOptions) -> Result<(), Box> { // force a no-skip-git let conf = config::read_and_validate_config()?; - config::update_time(conf)?; println!("Committing files to remote..."); git(repo_path, &["add", "."])?; - git(repo_path, &["commit", "-m", "Add new course"])?; + git(repo_path, &["commit", "-m", &format!("Add course: {}", conf.title)])?; git(repo_path, &["push"])?; + + config::update_time(conf)?; println!("Project successfully pushed to remote.");