add extraction script, fix bug with having too many file handles opened
This commit is contained in:
parent
43cef2c1d0
commit
5c89a5fa92
2
extract.sh
Executable file
2
extract.sh
Executable file
@ -0,0 +1,2 @@
|
|||||||
|
#!/usr/bin/sh
|
||||||
|
go run ./tools/mpq/*.go --target="./asset" extract ./mpq/*.mpq
|
@ -76,11 +76,13 @@ func extract(mpqPath, filter, targetDir string) error {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
defer sysFile.Close()
|
|
||||||
|
|
||||||
if _, err := io.Copy(sysFile, resFile); err != nil {
|
if _, err := io.Copy(sysFile, resFile); err != nil {
|
||||||
|
sysFile.Close()
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sysFile.Close()
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
Loading…
Reference in New Issue
Block a user