#![allow(dead_code)]
use std::fs;
use std::path::Path;
pub fn touch(dir: &Path, name: &str) {
let path = dir.join(name);
if let Some(parent) = path.parent() {
fs::create_dir_all(parent).unwrap();
}
fs::write(path, b"x").unwrap();
}
pub fn write(dir: &Path, name: &str, body: &str) {
let path = dir.join(name);
if let Some(parent) = path.parent() {
fs::create_dir_all(parent).unwrap();
}
fs::write(path, body).unwrap();
}
pub fn mkdir(dir: &Path, name: &str) {
fs::create_dir_all(dir.join(name)).unwrap();
}
pub fn type_names(matches: &[projectdetect::Match]) -> Vec<String> {
let mut v: Vec<String> = matches.iter().map(|m| m.r#type.clone()).collect();
v.sort();
v
}