mirror of
https://github.com/beego/bee.git
synced 2024-11-22 20:20:55 +00:00
Merge pull request #46 from ZhengYang/master
auto delete temp file while error
This commit is contained in:
commit
088a12f9bd
@ -263,6 +263,8 @@ func buildMigrationBinary(dir, binary string) {
|
|||||||
if out, err := cmd.CombinedOutput(); err != nil {
|
if out, err := cmd.CombinedOutput(); err != nil {
|
||||||
ColorLog("[ERRO] Could not build migration binary: %s\n", err)
|
ColorLog("[ERRO] Could not build migration binary: %s\n", err)
|
||||||
formatShellErrOutput(string(out))
|
formatShellErrOutput(string(out))
|
||||||
|
removeTempFile(dir, binary)
|
||||||
|
removeTempFile(dir, binary+".go")
|
||||||
os.Exit(2)
|
os.Exit(2)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -274,6 +276,8 @@ func runMigrationBinary(dir, binary string) {
|
|||||||
if out, err := cmd.CombinedOutput(); err != nil {
|
if out, err := cmd.CombinedOutput(); err != nil {
|
||||||
formatShellOutput(string(out))
|
formatShellOutput(string(out))
|
||||||
ColorLog("[ERRO] Could not run migration binary: %s\n", err)
|
ColorLog("[ERRO] Could not run migration binary: %s\n", err)
|
||||||
|
removeTempFile(dir, binary)
|
||||||
|
removeTempFile(dir, binary+".go")
|
||||||
os.Exit(2)
|
os.Exit(2)
|
||||||
} else {
|
} else {
|
||||||
formatShellOutput(string(out))
|
formatShellOutput(string(out))
|
||||||
|
Loading…
Reference in New Issue
Block a user