mirror of
https://github.com/lifegpc/msg-tool.git
synced 2026-06-24 12:47:04 +08:00
Extension name now support dot
This commit is contained in:
@@ -73,7 +73,7 @@ impl ScriptBuilder for ScnScriptBuilder {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn extensions(&self) -> &'static [&'static str] {
|
fn extensions(&self) -> &'static [&'static str] {
|
||||||
&["scn"]
|
&["ks.scn"]
|
||||||
}
|
}
|
||||||
|
|
||||||
fn script_type(&self) -> &'static ScriptType {
|
fn script_type(&self) -> &'static ScriptType {
|
||||||
|
|||||||
@@ -15,8 +15,16 @@ pub fn find_files(path: &str, recursive: bool, no_ext_filter: bool) -> io::Resul
|
|||||||
|
|
||||||
if path.is_file()
|
if path.is_file()
|
||||||
&& (no_ext_filter
|
&& (no_ext_filter
|
||||||
|| path.extension().map_or(true, |ext| {
|
|| path.file_name().map_or(false, |file| {
|
||||||
ALL_EXTS.contains(&ext.to_string_lossy().to_lowercase())
|
path.extension().map_or(true, |_| {
|
||||||
|
let file = file.to_string_lossy().to_lowercase();
|
||||||
|
for ext in ALL_EXTS.iter() {
|
||||||
|
if file.ends_with(&format!(".{}", ext)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
false
|
||||||
|
})
|
||||||
}))
|
}))
|
||||||
{
|
{
|
||||||
if let Some(path_str) = path.to_str() {
|
if let Some(path_str) = path.to_str() {
|
||||||
@@ -45,8 +53,16 @@ pub fn find_arc_files(path: &str, recursive: bool) -> io::Result<Vec<String>> {
|
|||||||
let path = entry.path();
|
let path = entry.path();
|
||||||
|
|
||||||
if path.is_file()
|
if path.is_file()
|
||||||
&& path.extension().map_or(false, |ext| {
|
&& path.file_name().map_or(false, |file| {
|
||||||
ARCHIVE_EXTS.contains(&ext.to_string_lossy().to_lowercase())
|
path.extension().map_or(true, |_| {
|
||||||
|
let file = file.to_string_lossy().to_lowercase();
|
||||||
|
for ext in ARCHIVE_EXTS.iter() {
|
||||||
|
if file.ends_with(&format!(".{}", ext)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
false
|
||||||
|
})
|
||||||
})
|
})
|
||||||
{
|
{
|
||||||
if let Some(path_str) = path.to_str() {
|
if let Some(path_str) = path.to_str() {
|
||||||
|
|||||||
Reference in New Issue
Block a user