2020-12-31 14:02:14 +00:00
|
|
|
use std::env;
|
|
|
|
|
2020-12-30 16:14:04 +00:00
|
|
|
pub mod migrator;
|
|
|
|
|
|
|
|
#[rocket::main]
|
|
|
|
async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
2020-12-31 14:02:14 +00:00
|
|
|
let args: Vec<String> = env::args().collect();
|
|
|
|
let db_path: &str = match &args[..] {
|
|
|
|
[_, path] => path.as_ref(),
|
|
|
|
[_, _, ..] => panic!("Expected exactly 0 or 1 argument"),
|
|
|
|
_ => "tenebrous.sqlite",
|
|
|
|
};
|
|
|
|
|
|
|
|
println!("Using database: {}", db_path);
|
|
|
|
|
|
|
|
crate::migrator::migrate(db_path).await
|
2020-12-30 16:14:04 +00:00
|
|
|
}
|