forked from mirror/pkger
remove out file if packing panics
This commit is contained in:
parent
7ee0500044
commit
8879dba851
|
@ -125,6 +125,11 @@ func (e *packCmd) Flags() *flag.FlagSet {
|
|||
|
||||
func Package(out string, decls parser.Decls) error {
|
||||
os.RemoveAll(out)
|
||||
defer func() {
|
||||
if err := recover(); err != nil {
|
||||
os.RemoveAll(out)
|
||||
}
|
||||
}()
|
||||
|
||||
f, err := os.Create(out)
|
||||
if err != nil {
|
||||
|
|
Loading…
Reference in New Issue