Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
B
beego
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
beego
Commits
bf0b1af6
Commit
bf0b1af6
authored
Apr 01, 2014
by
asta.xie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add workPath don't chdir when go run or go test
parent
9c959fba
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
3 deletions
+14
-3
config.go
config.go
+14
-3
No files found.
config.go
View file @
bf0b1af6
...
...
@@ -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
]))
os
.
Chdir
(
AppPath
)
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
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment