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