mirror of
https://github.com/beego/bee.git
synced 2024-11-25 20:10:55 +00:00
fix color log '#' issue and change remove temp file err to warning (does not halt)
This commit is contained in:
parent
ea3b10f2dc
commit
abc40f79a8
12
migrate.go
12
migrate.go
@ -16,6 +16,7 @@ package main
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"database/sql"
|
"database/sql"
|
||||||
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
"path"
|
"path"
|
||||||
@ -300,10 +301,9 @@ func changeDir(dir string) {
|
|||||||
|
|
||||||
// removeTempFile removes a file in dir
|
// removeTempFile removes a file in dir
|
||||||
func removeTempFile(dir, file string) {
|
func removeTempFile(dir, file string) {
|
||||||
os.Chdir(dir)
|
changeDir(dir)
|
||||||
if err := os.Remove(file); err != nil {
|
if err := os.Remove(file); err != nil {
|
||||||
ColorLog("[ERRO] Could not remove temporary migration files: %s\n", err)
|
ColorLog("[WARN] Could not remove temporary file: %s\n", err)
|
||||||
os.Exit(2)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -311,7 +311,8 @@ func removeTempFile(dir, file string) {
|
|||||||
func formatShellErrOutput(o string) {
|
func formatShellErrOutput(o string) {
|
||||||
for _, line := range strings.Split(o, "\n") {
|
for _, line := range strings.Split(o, "\n") {
|
||||||
if line != "" {
|
if line != "" {
|
||||||
ColorLog("[ERRO] -| %s\n", line)
|
ColorLog("[ERRO] -| ")
|
||||||
|
fmt.Println(line)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -320,7 +321,8 @@ func formatShellErrOutput(o string) {
|
|||||||
func formatShellOutput(o string) {
|
func formatShellOutput(o string) {
|
||||||
for _, line := range strings.Split(o, "\n") {
|
for _, line := range strings.Split(o, "\n") {
|
||||||
if line != "" {
|
if line != "" {
|
||||||
ColorLog("[INFO] -| %s\n", line)
|
ColorLog("[INFO] -| ")
|
||||||
|
fmt.Println(line)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user