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
9f7dc482
Commit
9f7dc482
authored
Oct 07, 2014
by
Peter Borzov
Committed by
Juan Batiz-Benet
Oct 09, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add supported Version.Check values as consts
parent
4c167a42
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
3 deletions
+9
-3
cmd/ipfs/ipfs.go
cmd/ipfs/ipfs.go
+3
-3
config/config.go
config/config.go
+6
-0
No files found.
cmd/ipfs/ipfs.go
View file @
9f7dc482
...
@@ -119,13 +119,13 @@ func localNode(confdir string, online bool) (*core.IpfsNode, error) {
...
@@ -119,13 +119,13 @@ func localNode(confdir string, online bool) (*core.IpfsNode, error) {
return
nil
,
err
return
nil
,
err
}
}
if
cfg
.
Version
.
Check
!=
"i
gnore
"
{
if
cfg
.
Version
.
Check
!=
config
.
CheckI
gnore
{
obsolete
:=
checkForUpdates
()
obsolete
:=
checkForUpdates
()
if
obsolete
!=
nil
{
if
obsolete
!=
nil
{
fmt
.
Println
(
obsolete
)
if
cfg
.
Version
.
Check
==
config
.
CheckError
{
if
cfg
.
Version
.
Check
==
"error"
{
return
nil
,
obsolete
return
nil
,
obsolete
}
}
fmt
.
Println
(
obsolete
)
// when "warn" version.check mode we just show warning message
}
}
}
}
...
...
config/config.go
View file @
9f7dc482
...
@@ -51,6 +51,12 @@ type Version struct {
...
@@ -51,6 +51,12 @@ type Version struct {
Current
string
`json:"current"`
// ipfs version for which config was generated
Current
string
`json:"current"`
// ipfs version for which config was generated
}
}
const
(
CheckError
=
"error"
// value for Version.Check to raise error and exit if version is obsolete
CheckWarn
=
"warn"
// value for Version.Check to show warning message if version is obsolete
CheckIgnore
=
"ignore"
// value for Version.Check to not perform update check
)
// Config is used to load IPFS config files.
// Config is used to load IPFS config files.
type
Config
struct
{
type
Config
struct
{
Identity
Identity
// local node's peer identity
Identity
Identity
// local node's peer identity
...
...
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