Add CLI option for uploading files + dummy hookup

I think this is the interface I want for uploading release files. There is an extra option to create the release ahead of the upload just in case it doesn't exist. One *should* create it with the create command or through the Gitea GUI so that everything can be properly written into the release info.
This commit is contained in:
2025-05-25 09:08:22 -05:00
parent 8843640385
commit 54487622c0
2 changed files with 21 additions and 0 deletions

View File

@@ -29,4 +29,12 @@ pub enum Commands {
#[arg()]
target_commitish: String,
},
UploadRelease {
#[arg()]
tag_name: String,
#[arg(short, long, default_value_t = false)]
create: bool,
#[arg()]
files: Vec<String>
}
}

View File

@@ -40,6 +40,19 @@ async fn main() -> Result<(), Error> {
};
do_create_release(&client, &args.gitea_url, &args.repo, submission).await?;
}
gt_tools::cli::Commands::UploadRelease {
tag_name,
create,
files
} => {
println!("Uploading files to a release!");
println!("Release Tag: {tag_name}");
println!("Creating?: {create}");
println!("Files...");
for file in files {
println!("--- {file}");
}
}
}
Ok(())