diff --git a/main.go b/main.go index 20a5ef8..73cfff6 100644 --- a/main.go +++ b/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()