check run
Wide can't run in the OS' temp directory and it can't run with `go run`
This commit is contained in:
parent
8de1b0a0bc
commit
197385b414
9
main.go
9
main.go
|
@ -20,8 +20,10 @@ import (
|
|||
"math/rand"
|
||||
"mime"
|
||||
"net/http"
|
||||
"os"
|
||||
"runtime"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/b3log/wide/conf"
|
||||
|
@ -53,6 +55,13 @@ func init() {
|
|||
|
||||
flag.Parse()
|
||||
|
||||
wd := util.OS.Pwd()
|
||||
if strings.HasPrefix(wd, os.TempDir()) {
|
||||
glog.Error("Wide can't run in the OS' temp directory and it can't run with `go run`")
|
||||
|
||||
os.Exit(-1)
|
||||
}
|
||||
|
||||
i18n.Load()
|
||||
|
||||
event.Load()
|
||||
|
|
Loading…
Reference in New Issue