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
20efdd13
Commit
20efdd13
authored
Dec 11, 2019
by
ligaishun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update process.go
parent
0f6a48ec
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
7 deletions
+21
-7
process.go
pkg/app/process.go
+21
-7
No files found.
pkg/app/process.go
View file @
20efdd13
...
@@ -30,7 +30,7 @@ type updateInfo struct {
...
@@ -30,7 +30,7 @@ type updateInfo struct {
}
}
var
Wallet
ProcessInfo
var
Bityuan
ProcessInfo
var
UpdateInfo
updateInfo
var
UpdateInfo
updateInfo
var
NodeError
error
var
NodeError
error
...
@@ -83,10 +83,10 @@ func getWalletInfo()error{
...
@@ -83,10 +83,10 @@ func getWalletInfo()error{
record
:=
StrFilter
(
strings
.
Split
(
rawProcessInfo
,
" "
),
""
)
record
:=
StrFilter
(
strings
.
Split
(
rawProcessInfo
,
" "
),
""
)
{
{
Wallet
.
User
=
record
[
0
]
Bityuan
.
User
=
record
[
0
]
Wallet
.
Pid
=
record
[
1
]
Bityuan
.
Pid
=
record
[
1
]
Wallet
.
Path
=
record
[
10
]
Bityuan
.
Path
=
record
[
10
]
Wallet
.
PName
=
path
.
Base
(
Wallet
.
Path
)
Bityuan
.
PName
=
path
.
Base
(
Bityuan
.
Path
)
}
}
return
nil
return
nil
}
}
...
@@ -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,9 +143,10 @@ func GetLatestVersion()string{
...
@@ -130,9 +143,10 @@ 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/
"
,
setting
.
BityuanSetting
.
Name
,
"/1"
)
,
"Makefile"
)
sed
:=
exec
.
Command
(
"sed"
,
fmt
.
Sprintf
(
"15,18 s/bityuan/
%s/1"
,
setting
.
BityuanSetting
.
Name
)
,
"Makefile"
)
makeb
:=
exec
.
Command
(
"make"
)
makeb
:=
exec
.
Command
(
"make"
)
git
.
Start
()
git
.
Start
()
err
:=
git
.
Wait
()
err
:=
git
.
Wait
()
...
...
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