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
1fb24aca
Commit
1fb24aca
authored
Aug 04, 2014
by
astaxie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
beego: commentsrouter use the workPath fix #708
parent
885c0678
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
parser.go
parser.go
+5
-5
No files found.
parser.go
View file @
1fb24aca
...
@@ -114,7 +114,7 @@ func parserComments(comments *ast.CommentGroup, funcName, controllerName, pkgpat
...
@@ -114,7 +114,7 @@ func parserComments(comments *ast.CommentGroup, funcName, controllerName, pkgpat
}
}
func
genRouterCode
()
{
func
genRouterCode
()
{
os
.
Mkdir
(
path
.
Join
(
App
Path
,
"routers"
),
0755
)
os
.
Mkdir
(
path
.
Join
(
work
Path
,
"routers"
),
0755
)
Info
(
"generate router from comments"
)
Info
(
"generate router from comments"
)
var
globalinfo
string
var
globalinfo
string
for
k
,
cList
:=
range
genInfoList
{
for
k
,
cList
:=
range
genInfoList
{
...
@@ -148,7 +148,7 @@ func genRouterCode() {
...
@@ -148,7 +148,7 @@ func genRouterCode() {
}
}
}
}
if
globalinfo
!=
""
{
if
globalinfo
!=
""
{
f
,
err
:=
os
.
Create
(
path
.
Join
(
App
Path
,
"routers"
,
"commentsRouter.go"
))
f
,
err
:=
os
.
Create
(
path
.
Join
(
work
Path
,
"routers"
,
"commentsRouter.go"
))
if
err
!=
nil
{
if
err
!=
nil
{
panic
(
err
)
panic
(
err
)
}
}
...
@@ -158,8 +158,8 @@ func genRouterCode() {
...
@@ -158,8 +158,8 @@ func genRouterCode() {
}
}
func
compareFile
(
pkgRealpath
string
)
bool
{
func
compareFile
(
pkgRealpath
string
)
bool
{
if
utils
.
FileExists
(
path
.
Join
(
App
Path
,
lastupdateFilename
))
{
if
utils
.
FileExists
(
path
.
Join
(
work
Path
,
lastupdateFilename
))
{
content
,
err
:=
ioutil
.
ReadFile
(
path
.
Join
(
App
Path
,
lastupdateFilename
))
content
,
err
:=
ioutil
.
ReadFile
(
path
.
Join
(
work
Path
,
lastupdateFilename
))
if
err
!=
nil
{
if
err
!=
nil
{
return
true
return
true
}
}
...
@@ -187,7 +187,7 @@ func savetoFile(pkgRealpath string) {
...
@@ -187,7 +187,7 @@ func savetoFile(pkgRealpath string) {
if
err
!=
nil
{
if
err
!=
nil
{
return
return
}
}
ioutil
.
WriteFile
(
path
.
Join
(
App
Path
,
lastupdateFilename
),
d
,
os
.
ModePerm
)
ioutil
.
WriteFile
(
path
.
Join
(
work
Path
,
lastupdateFilename
),
d
,
os
.
ModePerm
)
}
}
func
getpathTime
(
pkgRealpath
string
)
(
lastupdate
int64
,
err
error
)
{
func
getpathTime
(
pkgRealpath
string
)
(
lastupdate
int64
,
err
error
)
{
...
...
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