Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
张磊
/
FileStorageBeego
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
bf0b1af6
authored
2014-04-01 18:08:00 +0800
by
asta.xie
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
add workPath don't chdir when go run or go test
1 parent
9c959fba
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
2 deletions
config.go
config.go
View file @
bf0b1af
...
...
@@ -11,12 +11,14 @@ import (
"github.com/astaxie/beego/config"
"github.com/astaxie/beego/logs"
"github.com/astaxie/beego/session"
"github.com/astaxie/beego/utils"
)
var
(
BeeApp
*
App
// beego application
AppName
string
AppPath
string
workPath
string
AppConfigPath
string
StaticDir
map
[
string
]
string
TemplateCache
map
[
string
]
*
template
.
Template
// template caching map
...
...
@@ -66,9 +68,20 @@ func init() {
// create beego application
BeeApp
=
NewApp
()
workPath
,
_
=
os
.
Getwd
()
workPath
,
_
=
filepath
.
Abs
(
workPath
)
// initialize default configurations
AppPath
,
_
=
filepath
.
Abs
(
filepath
.
Dir
(
os
.
Args
[
0
]))
AppConfigPath
=
filepath
.
Join
(
AppPath
,
"conf"
,
"app.conf"
)
if
workPath
!=
AppPath
{
if
utils
.
FileExists
(
AppConfigPath
)
{
os
.
Chdir
(
AppPath
)
}
else
{
AppConfigPath
=
filepath
.
Join
(
workPath
,
"conf"
,
"app.conf"
)
}
}
StaticDir
=
make
(
map
[
string
]
string
)
StaticDir
[
"/static"
]
=
"static"
...
...
@@ -107,8 +120,6 @@ func init() {
EnableGzip
=
false
AppConfigPath
=
filepath
.
Join
(
AppPath
,
"conf"
,
"app.conf"
)
HttpServerTimeOut
=
0
ErrorsShow
=
true
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment