fixed an oopsie with exclusions

This commit is contained in:
Karim Akra
2025-08-08 01:04:18 +07:00
committed by MoonDroid
parent a75c41b813
commit c142add8a1
3 changed files with 7 additions and 8 deletions
-1
View File
@@ -4,7 +4,6 @@
"quality": "medium",
"blocksize": "10x10",
"colorprofile": "cl",
"clean": false,
"custom": [
{
"asset": "assets/shared/images/resultScreen/",
+1 -1
View File
@@ -11,7 +11,7 @@
"name": "astc-compressor",
"type": "git",
"dir": null,
"ref": "2da942476abebbc7f47e0b228f89320e8ef07167",
"ref": "9b0819150b67bf0d49145f250099b75d21be5839",
"url": "https://github.com/KarimAkra/astc-compressor"
},
{
+6 -6
View File
@@ -1762,27 +1762,27 @@ class Project extends HXProject
astcExcludes[i] = astcExcludes[i].trim();
}
public function isASTCExcluded(filePath:String):Bool
public function isASTCExcluded(file:String):Bool
{
for (exclusion in astcExcludes)
{
if (exclusion.endsWith("/"))
{
var normalizedFilePath = Path.normalize(filePath);
var normalizedExclusion = Path.normalize(exclusion.substr(0, exclusion.length - 2));
var normalizedFilePath = Path.normalize(file);
var normalizedExclusion = Path.normalize(exclusion);
if (normalizedFilePath.startsWith(normalizedExclusion)) return true;
}
else if (exclusion.endsWith("/*"))
{
var normalizedExclusion = Path.normalize(exclusion);
var fileDirectory = Path.directory(Path.normalize(filePath));
var normalizedExclusion = Path.normalize(exclusion.substr(0, exclusion.length - 2));
var fileDirectory = Path.directory(Path.normalize(file));
if (fileDirectory == normalizedExclusion) return true;
}
else
{
if (filePath == exclusion) return true;
if (file == exclusion) return true;
}
}