mirror of
https://github.com/watchexec/watchexec.git
synced 2024-11-16 17:18:30 +01:00
19 lines
456 B
Rust
19 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(())
|
|
}
|