watchexec/lib/src/project.rs

36 lines
665 B
Rust
Raw Normal View History

2021-10-09 07:45:32 +02:00
//! Detect project type and origin.
use std::{
io::Error,
path::{Path, PathBuf},
};
2021-10-09 07:45:32 +02:00
pub async fn origins(path: impl AsRef<Path>) -> Result<Vec<PathBuf>, Error> {
2021-10-09 07:45:32 +02:00
todo!()
}
/// Returns all project types detected at this given origin.
///
/// This should be called with a result of [`origins()`], or a project origin if already known; it
2021-10-09 07:45:32 +02:00
/// will not find the origin itself.
pub async fn types(path: impl AsRef<Path>) -> Result<Vec<ProjectType>, Error> {
2021-10-09 07:45:32 +02:00
todo!()
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
#[non_exhaustive]
2021-10-09 07:45:32 +02:00
pub enum ProjectType {
Bazaar,
Darcs,
Fossil,
2021-10-09 07:45:32 +02:00
Git,
Mercurial,
Pijul,
Bundler,
2021-10-09 07:45:32 +02:00
Cargo,
JavaScript,
Pip,
RubyGem,
2021-10-09 07:45:32 +02:00
}