Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-unixfs
Commits
0115d1e0
Commit
0115d1e0
authored
Oct 20, 2014
by
Henry
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
respect cfg.Version.Check
parent
cb73ea7b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
18 deletions
+22
-18
cmd/ipfs/ipfs.go
cmd/ipfs/ipfs.go
+22
-18
No files found.
cmd/ipfs/ipfs.go
View file @
0115d1e0
...
...
@@ -133,26 +133,30 @@ func localNode(confdir string, online bool) (*core.IpfsNode, error) {
u
,
err
:=
updates
.
CheckForUpdate
()
if
err
!=
nil
{
if
err
!=
check
.
NoUpdateAvailable
{
log
.
Error
(
"Error while checking for update: %v
\n
"
,
err
)
return
nil
,
err
}
log
.
Notice
(
"No update available, checked on %s"
,
time
.
Now
())
}
config
.
RecordUpdateCheck
(
cfg
,
filename
)
if
u
!=
nil
&&
cfg
.
Version
.
AutoUpdate
!=
config
.
UpdateNever
{
if
updates
.
ShouldAutoUpdate
(
cfg
.
Version
.
AutoUpdate
,
u
.
Version
)
{
log
.
Notice
(
"Applying update %s"
,
u
.
Version
)
if
err
=
updates
.
Apply
(
u
);
err
!=
nil
{
log
.
Error
(
err
.
Error
())
if
cfg
.
Version
.
Check
==
config
.
CheckError
{
log
.
Error
(
"Error while checking for update: %v
\n
"
,
err
)
return
nil
,
err
}
// BUG(cryptix): no good way to restart yet. - tracking https://github.com/inconshreveable/go-update/issues/5
fmt
.
Println
(
"update %v applied. please restart."
,
u
.
Version
)
os
.
Exit
(
0
)
// when "warn" version.check mode we just show a warning message
log
.
Warning
(
err
.
Error
())
}
else
{
// err == check.NoUpdateAvailable
log
.
Notice
(
"No update available, checked on %s"
,
time
.
Now
())
config
.
RecordUpdateCheck
(
cfg
,
filename
)
}
}
else
{
// update avail
if
cfg
.
Version
.
AutoUpdate
!=
config
.
UpdateNever
{
if
updates
.
ShouldAutoUpdate
(
cfg
.
Version
.
AutoUpdate
,
u
.
Version
)
{
log
.
Notice
(
"Applying update %s"
,
u
.
Version
)
if
err
=
updates
.
Apply
(
u
);
err
!=
nil
{
log
.
Error
(
err
.
Error
())
return
nil
,
err
}
// BUG(cryptix): no good way to restart yet. - tracking https://github.com/inconshreveable/go-update/issues/5
fmt
.
Println
(
"update %v applied. please restart."
,
u
.
Version
)
os
.
Exit
(
0
)
}
}
}
}
...
...
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