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"
|
"math/rand"
|
||||||
"mime"
|
"mime"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
"os"
|
||||||
"runtime"
|
"runtime"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/b3log/wide/conf"
|
"github.com/b3log/wide/conf"
|
||||||
|
@ -53,6 +55,13 @@ func init() {
|
||||||
|
|
||||||
flag.Parse()
|
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()
|
i18n.Load()
|
||||||
|
|
||||||
event.Load()
|
event.Load()
|
||||||
|
|
Loading…
Reference in New Issue