diff options
Diffstat (limited to 'tools/src/bin/create_item.rs')
-rw-r--r-- | tools/src/bin/create_item.rs | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/tools/src/bin/create_item.rs b/tools/src/bin/create_item.rs deleted file mode 100644 index eb5b3a9..0000000 --- a/tools/src/bin/create_item.rs +++ /dev/null @@ -1,34 +0,0 @@ -use std::{fs::File, io::Write, path::PathBuf}; - -use clap::Parser; -use jellycommon::ItemInfo; - -#[derive(Parser)] -struct Args { - #[clap(short = 'I', long)] - item: PathBuf, - #[clap(short = 'd', long)] - dry: bool, - #[clap(short, long)] - title: String, -} - -fn main() -> anyhow::Result<()> { - let args = Args::parse(); - - let iteminfo = ItemInfo { - title: args.title, - path: String::new(), - duration: 0.0, - tracks: Default::default(), - }; - - let k = serde_json::to_string_pretty(&iteminfo)?; - if args.dry { - println!("{k}") - } else { - let mut f = File::create(args.item)?; - f.write_all(k.as_bytes())?; - } - Ok(()) -} |