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
0
Merge Requests
0
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
ligaishun
chain33-pai
Commits
3ea79b72
Commit
3ea79b72
authored
Dec 11, 2019
by
ligaishun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update process.go
parent
614cbdd4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
1 deletion
+15
-1
process.go
pkg/app/process.go
+15
-1
No files found.
pkg/app/process.go
View file @
3ea79b72
...
@@ -114,10 +114,23 @@ func CornProcessJob(ticker *time.Ticker){
...
@@ -114,10 +114,23 @@ func CornProcessJob(ticker *time.Ticker){
}
}
func
GetLatestVersion
()
string
{
func
GetLatestVersion
()
string
{
resp
,
_
:=
http
.
Get
(
setting
.
BityuanSetting
.
VersionPath
)
req
,
err
:=
http
.
NewRequest
(
"GET"
,
setting
.
BityuanSetting
.
VersionPath
,
nil
)
req
.
Close
=
true
req
.
Header
.
Add
(
"Connection"
,
"close"
)
if
err
!=
nil
{
return
""
}
resp
,
err
:=
http
.
DefaultClient
.
Do
(
req
)
if
err
!=
nil
{
fmt
.
Println
(
err
)
return
""
}
defer
resp
.
Body
.
Close
()
rd
:=
bufio
.
NewReader
(
resp
.
Body
)
rd
:=
bufio
.
NewReader
(
resp
.
Body
)
for
{
for
{
line
,
err
:=
rd
.
ReadString
(
'\n'
)
line
,
err
:=
rd
.
ReadString
(
'\n'
)
fmt
.
Println
(
line
)
if
err
==
io
.
EOF
{
if
err
==
io
.
EOF
{
break
break
}
}
...
@@ -130,6 +143,7 @@ func GetLatestVersion()string{
...
@@ -130,6 +143,7 @@ func GetLatestVersion()string{
}
}
func
DownLoadLatestVersion
()
error
{
func
DownLoadLatestVersion
()
error
{
git
:=
exec
.
Command
(
"git"
,
"clone"
,
setting
.
BityuanSetting
.
GitPath
,
"./"
+
setting
.
BityuanSetting
.
Name
)
git
:=
exec
.
Command
(
"git"
,
"clone"
,
setting
.
BityuanSetting
.
GitPath
,
"./"
+
setting
.
BityuanSetting
.
Name
)
sed
:=
exec
.
Command
(
"sed"
,
fmt
.
Sprintf
(
"15,18 s/bityuan/%s/1"
,
setting
.
BityuanSetting
.
Name
)
,
"Makefile"
)
sed
:=
exec
.
Command
(
"sed"
,
fmt
.
Sprintf
(
"15,18 s/bityuan/%s/1"
,
setting
.
BityuanSetting
.
Name
)
,
"Makefile"
)
...
...
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