A decentralized music tracking and discovery platform built on AT Protocol 馃幍
at feat/discord-webhook 37 lines 824 B view raw
1use clap::Command; 2use cmd::{scan::scan, serve::serve}; 3use dotenv::dotenv; 4 5pub mod client; 6pub mod cmd; 7pub mod consts; 8pub mod crypto; 9pub mod handlers; 10pub mod repo; 11pub mod scan; 12pub mod token; 13pub mod types; 14pub mod xata; 15 16fn cli() -> Command { 17 Command::new("dropbox") 18 .version(env!("CARGO_PKG_VERSION")) 19 .about("Rocksky Dropbox Service") 20 .subcommand(Command::new("scan").about("Scan Dropbox Music Folder")) 21 .subcommand(Command::new("serve").about("Serve Rocksky Dropbox API")) 22} 23 24#[tokio::main] 25async fn main() -> Result<(), Box<dyn std::error::Error>> { 26 dotenv().ok(); 27 28 let args = cli().get_matches(); 29 30 match args.subcommand() { 31 Some(("scan", _)) => scan().await?, 32 Some(("serve", _)) => serve().await?, 33 _ => serve().await?, 34 } 35 36 Ok(()) 37}