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)
|
||||
|
||||
Reference in New Issue
Block a user