|
|
|
@ -36,10 +36,16 @@ impl Directories {
|
|
|
|
|
text_messages.warnings.push("Included Directory Warning: Wildcards in path are not supported, ignoring ".to_string() + directory.as_str());
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
#[cfg(target_family = "unix")]
|
|
|
|
|
if !directory.starts_with('/') {
|
|
|
|
|
text_messages.warnings.push("Included Directory Warning: Relative path are not supported, ignoring ".to_string() + directory.as_str());
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
#[cfg(target_family = "windows")]
|
|
|
|
|
if !(directory[..directory.len()].starts_with(":/") || !directory[..directory.len()].starts_with(":\\")) {
|
|
|
|
|
text_messages.warnings.push("Included Directory Warning: Relative path are not supported, ignoring ".to_string() + directory.as_str());
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
if !Path::new(&directory).exists() {
|
|
|
|
|
text_messages.warnings.push("Included Directory Warning: Provided folder path must exits, ignoring ".to_string() + directory.as_str());
|
|
|
|
|
continue;
|
|
|
|
@ -80,7 +86,7 @@ impl Directories {
|
|
|
|
|
let mut checked_directories: Vec<String> = Vec::new();
|
|
|
|
|
|
|
|
|
|
for directory in directories {
|
|
|
|
|
let directory: String = directory.trim().to_string();
|
|
|
|
|
let directory: String = directory.trim().to_string().replace("\\", "/");
|
|
|
|
|
|
|
|
|
|
if directory == "" {
|
|
|
|
|
continue;
|
|
|
|
@ -93,12 +99,14 @@ impl Directories {
|
|
|
|
|
text_messages.warnings.push("Excluded Directory Warning: Wildcards in path are not supported, ignoring ".to_string() + directory.as_str());
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
#[cfg(target_family = "unix")]
|
|
|
|
|
if !directory.starts_with('/') {
|
|
|
|
|
text_messages.warnings.push("Excluded Directory Warning: Relative path are not supported, ignoring ".to_string() + directory.as_str());
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
if !Path::new(&directory).exists() {
|
|
|
|
|
text_messages.warnings.push("Excluded Directory Warning: Provided folder path must exits, ignoring ".to_string() + directory.as_str());
|
|
|
|
|
#[cfg(target_family = "windows")]
|
|
|
|
|
if !(directory[..directory.len()].starts_with(":/") || !directory[..directory.len()].starts_with(":\\")) {
|
|
|
|
|
text_messages.warnings.push("Excluded Directory Warning: Relative path are not supported, ignoring ".to_string() + directory.as_str());
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
if !Path::new(&directory).is_dir() {
|
|
|
|
@ -125,6 +133,13 @@ impl Directories {
|
|
|
|
|
let mut optimized_included: Vec<String> = Vec::<String>::new();
|
|
|
|
|
let mut optimized_excluded: Vec<String> = Vec::<String>::new();
|
|
|
|
|
|
|
|
|
|
// Windows(or specific EXT4 extension) doesn't recognize size of letters so we must remove one of directory e.g. - C:/h.txt, C:/H.txt
|
|
|
|
|
#[cfg(target_family = "windows")]
|
|
|
|
|
{
|
|
|
|
|
self.included_directories = self.included_directories.iter().map(Common::prettier_windows_path).collect();
|
|
|
|
|
self.excluded_directories = self.excluded_directories.iter().map(Common::prettier_windows_path).collect();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Remove duplicated entries like: "/", "/"
|
|
|
|
|
|
|
|
|
|
self.excluded_directories.sort();
|
|
|
|
|