mirror of
https://github.com/watchexec/watchexec.git
synced 2024-11-16 09:08:37 +01:00
19 lines
446 B
Rust
19 lines
446 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 = dunce::canonicalize(first_arg).into_diagnostic()?;
|
|
|
|
for origin in origins(&path).await {
|
|
println!("{}", origin.display());
|
|
}
|
|
|
|
Ok(())
|
|
}
|