Skip to content

Commit

Permalink
add bins
Browse files Browse the repository at this point in the history
  • Loading branch information
ggagosh committed Sep 15, 2022
1 parent b3eed1a commit 76f0a12
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
9 changes: 8 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,15 @@
name = "karkinos"
version = "0.0.1"
edition = "2021"
default-run = "main"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[[bin]]
name = "main"
path = "src/main.rs"

[[bin]]
name = "gen"
path = "src/gen.rs"

[dependencies]
serde = { version = "1.0", features = ["derive"] }
Expand Down
4 changes: 2 additions & 2 deletions src/bin/gen.rs → src/gen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ extern crate serde_json;
use schemars::schema_for;
use std::fs::File;

#[path = "../types.rs"]
#[path = "types.rs"]
mod types;

fn main() {
let dest = File::create("krk-schema.json").expect("can't create json schema file :(");
let dest = File::create("../krk-schema.json").expect("can't create json schema file :(");
let schema = schema_for!(types::ScrapeRoot);

serde_json::to_writer_pretty(dest, &schema).unwrap();
Expand Down

0 comments on commit 76f0a12

Please sign in to comment.