Skip to content

Commit

Permalink
Cli improvemnts and cargo updates for pending CI workflow testing
Browse files Browse the repository at this point in the history
  • Loading branch information
mburridge96 committed Nov 21, 2024
1 parent 959605f commit e7f3c84
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 11 deletions.
5 changes: 0 additions & 5 deletions .github/workflows/cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@

on:
push:
branches: [ "main" ]
tags:
- '*'
pull_request:
branches: [ "main" ]

jobs:
release:
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 8 additions & 1 deletion cli/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
[package]
name = "ro-crate-rs-cli"
version = "0.4.4"
version = "0.4.5"
edition = "2021"
repository = "https://github.com/intbio-ncl/ro-crate-rs"
authors = ["Matt Burridge <[email protected]>"]
autoexamples = false
license = "Apache-2.0"
description = "Cli tool for creating, modifying, validating and reading RO-Crates"
keywords = ["researchobject","ro-crate","ro","metadata","jsonld"]
categories = ["command-line-utilities"]

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

Expand Down
1 change: 1 addition & 0 deletions cli/src/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ pub struct InitCommand {
pub default: bool,
/// Type of context
#[clap(required_unless_present = "default")]
#[clap(required_unless_present = "minimal")]
#[clap(short, long, name="context", help=CONTEXT_HELP)]
pub context_type: Option<ContextType>,
/// Initialise with default minimal entites or leave empty
Expand Down
12 changes: 8 additions & 4 deletions cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,16 @@ fn main() {

match args.crate_action {
CrateAction::Init(init_command) => {
if init_command.default {
if init_command.minimal {
let mut rocrate = RoCrate::default();
rocrate = create_default_crate(rocrate);
write_crate(&rocrate, "ro-crate-metadata.json".to_string());
return;
}

if init_command.default {
let rocrate = RoCrate::default();
println!("{:?}", rocrate);
if init_command.minimal {
rocrate = create_default_crate(rocrate);
}

write_crate(&rocrate, "ro-crate-metadata.json".to_string())
} else {
Expand Down

0 comments on commit e7f3c84

Please sign in to comment.