2021-10-09 07:45:32 +02:00
|
|
|
//! Detect project type and origin.
|
|
|
|
|
2021-10-10 05:03:05 +02:00
|
|
|
use std::{
|
|
|
|
io::Error,
|
|
|
|
path::{Path, PathBuf},
|
|
|
|
};
|
2021-10-09 07:45:32 +02:00
|
|
|
|
2021-10-10 05:03:05 +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.
|
|
|
|
///
|
2021-10-10 05:03:05 +02:00
|
|
|
/// 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.
|
2021-10-10 05:03:05 +02:00
|
|
|
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)]
|
2021-10-10 05:03:05 +02:00
|
|
|
#[non_exhaustive]
|
2021-10-09 07:45:32 +02:00
|
|
|
pub enum ProjectType {
|
2021-10-10 05:03:05 +02:00
|
|
|
Bazaar,
|
|
|
|
Darcs,
|
|
|
|
Fossil,
|
2021-10-09 07:45:32 +02:00
|
|
|
Git,
|
|
|
|
Mercurial,
|
|
|
|
Pijul,
|
|
|
|
|
2021-10-10 05:03:05 +02:00
|
|
|
Bundler,
|
2021-10-09 07:45:32 +02:00
|
|
|
Cargo,
|
|
|
|
JavaScript,
|
|
|
|
Pip,
|
2021-10-10 05:03:05 +02:00
|
|
|
RubyGem,
|
2021-10-09 07:45:32 +02:00
|
|
|
}
|