fix: ensure parent directories exist before extracting files

extractDir was writing files without creating parent directories first,
causing "The system cannot find the path specified" errors on Windows
when models.json was walked before the data/ directory entry.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
jim800121chen 2026-03-09 18:41:23 +08:00
parent ecabffc890
commit 9110e1647d

View File

@ -378,6 +378,11 @@ func (inst *Installer) extractDir(embedDir, destDir string) error {
return os.MkdirAll(outPath, 0755)
}
// Ensure parent directory exists
if err := os.MkdirAll(filepath.Dir(outPath), 0755); err != nil {
return fmt.Errorf("create dir for %s: %w", outPath, err)
}
data, err := inst.payload.ReadFile(path)
if err != nil {
return fmt.Errorf("read embedded %s: %w", path, err)