Fix type extensions 2
This commit is contained in:
@@ -526,9 +526,9 @@ func resourceFromJSON(path string, moduleHakOrder []string) (erf.Resource, error
|
||||
|
||||
func pathResource(path string) (erf.Resource, error) {
|
||||
extension := strings.TrimPrefix(strings.ToLower(filepath.Ext(path)), ".")
|
||||
resourceType, ok := erf.ResourceTypeForExtension(extension)
|
||||
resourceType, ok := erf.HAKResourceTypeForExtension(extension)
|
||||
if !ok {
|
||||
return erf.Resource{}, fmt.Errorf("unsupported resource extension %q", filepath.Ext(path))
|
||||
return erf.Resource{}, fmt.Errorf("unsupported HAK resource extension %q", filepath.Ext(path))
|
||||
}
|
||||
name := strings.ToLower(strings.TrimSuffix(filepath.Base(path), filepath.Ext(path)))
|
||||
info, err := os.Stat(path)
|
||||
@@ -545,9 +545,9 @@ func pathResource(path string) (erf.Resource, error) {
|
||||
|
||||
func rawResource(path string) (erf.Resource, error) {
|
||||
extension := strings.TrimPrefix(strings.ToLower(filepath.Ext(path)), ".")
|
||||
resourceType, ok := erf.ResourceTypeForExtension(extension)
|
||||
resourceType, ok := erf.HAKResourceTypeForExtension(extension)
|
||||
if !ok {
|
||||
return erf.Resource{}, fmt.Errorf("unsupported resource extension %q", filepath.Ext(path))
|
||||
return erf.Resource{}, fmt.Errorf("unsupported HAK resource extension %q", filepath.Ext(path))
|
||||
}
|
||||
name := strings.ToLower(strings.TrimSuffix(filepath.Base(path), filepath.Ext(path)))
|
||||
data, err := os.ReadFile(path)
|
||||
|
||||
@@ -473,7 +473,7 @@ func TestBuildBuildsTopPackageAndInjectsHAKList(t *testing.T) {
|
||||
"rows": [{"id": 0, "Label": "TEST_LABEL"}]
|
||||
}
|
||||
`)
|
||||
mustWriteFile(t, filepath.Join(root, "topdata", "assets", "gui", "testicon.tga"), "icon-data")
|
||||
mustWriteFile(t, filepath.Join(root, "topdata", "assets", "gui", "testicon.png"), "icon-data")
|
||||
|
||||
p, err := project.Load(root)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user