mirror of
https://github.com/watchexec/watchexec.git
synced 2024-09-07 20:11:29 +02:00
20 lines
456 B
Rust
20 lines
456 B
Rust
use std::env::args;
|
|
|
|
use miette::{IntoDiagnostic, Result};
|
|
use project_origins::origins;
|
|
|
|
// Run with: `cargo run --example find-origins [PATH]`
|
|
#[tokio::main]
|
|
async fn main() -> Result<()> {
|
|
tracing_subscriber::fmt::init();
|
|
|
|
let first_arg = args().nth(1).unwrap_or_else(|| ".".to_string());
|
|
let path = tokio::fs::canonicalize(first_arg).await.into_diagnostic()?;
|
|
|
|
for origin in origins(&path).await {
|
|
println!("{}", origin.display());
|
|
}
|
|
|
|
Ok(())
|
|
}
|