Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
chain33-pai
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
szh
chain33-pai
Commits
0e2d495f
Commit
0e2d495f
authored
Jan 07, 2020
by
szh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pai升级替换配置文件,用户不需要改配置文件
parent
a7808a46
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
2 deletions
+16
-2
pai.go
routers/api/v1/pai.go
+16
-2
No files found.
routers/api/v1/pai.go
View file @
0e2d495f
...
@@ -166,8 +166,22 @@ func UpdatePai(c *gin.Context) {
...
@@ -166,8 +166,22 @@ func UpdatePai(c *gin.Context) {
app
.
DPercent
.
Flag
=
false
app
.
DPercent
.
Flag
=
false
return
return
}
}
//对比配置文件 比较麻烦
//替换配置文件
mvconf
:=
exec
.
Command
(
"mv"
,
setting
.
Chain33Pai
.
Name
+
"_"
+
req
.
Version
+
"/conf/app.ini"
,
"."
)
err
=
mvconf
.
Start
()
if
err
!=
nil
{
tlog
.
Error
(
"mvconf"
,
"err"
,
err
)
appG
.
Response
(
http
.
StatusOK
,
e
.
MV_ERROR
,
err
)
app
.
DPercent
.
Flag
=
false
return
}
err
=
mvconf
.
Wait
()
if
err
!=
nil
{
tlog
.
Error
(
"mvconf"
,
"err"
,
err
)
appG
.
Response
(
http
.
StatusOK
,
e
.
MV_ERROR
,
err
)
app
.
DPercent
.
Flag
=
false
return
}
//删除temp文件夹
//删除temp文件夹
//替换原执行文件
//替换原执行文件
remove
:=
exec
.
Command
(
"rm"
,
"-rf"
,
setting
.
Chain33Pai
.
Name
+
"_"
+
req
.
Version
,
name
)
remove
:=
exec
.
Command
(
"rm"
,
"-rf"
,
setting
.
Chain33Pai
.
Name
+
"_"
+
req
.
Version
,
name
)
...
...
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