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-dms3
Commits
c6b74207
Commit
c6b74207
authored
Nov 04, 2014
by
Juan Batiz-Benet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
config/init: init Version with CheckPeriod #265
parent
866c2c89
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
5 deletions
+12
-5
cmd/ipfs/init.go
cmd/ipfs/init.go
+1
-4
config/version.go
config/version.go
+11
-1
No files found.
cmd/ipfs/init.go
View file @
c6b74207
...
...
@@ -136,10 +136,7 @@ func initCmd(c *commander.Command, inp []string) error {
}
// tracking ipfs version used to generate the init folder and adding update checker default setting.
cfg
.
Version
=
config
.
Version
{
Check
:
"error"
,
Current
:
updates
.
Version
,
}
cfg
.
Version
=
config
.
VersionDefaultValue
()
err
=
config
.
WriteConfigFile
(
filename
,
cfg
)
if
err
!=
nil
{
...
...
config/version.go
View file @
c6b74207
...
...
@@ -127,8 +127,18 @@ func RecordUpdateCheck(cfg *Config, filename string) {
if
cfg
.
Version
.
CheckPeriod
==
""
{
// CheckPeriod was not initialized for some reason (e.g. config file broken)
cf
g
.
Version
.
CheckPeriod
=
strconv
.
Itoa
(
int
(
defaultCheckPeriod
)
)
log
.
Error
(
"confi
g.Version.CheckPeriod
not set. config broken?"
)
}
WriteConfigFile
(
filename
,
cfg
)
}
// VersionDefaultValue returns the default version config value (for init).
func
VersionDefaultValue
()
Version
{
return
Version
{
Current
:
CurrentVersionNumber
,
Check
:
"error"
,
CheckPeriod
:
strconv
.
Itoa
(
int
(
defaultCheckPeriod
)),
AutoUpdate
:
AutoUpdateMinor
,
}
}
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