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
f1e08850
Commit
f1e08850
authored
10 years ago
by
Matt Bell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
config: Made WriteConfigFile create config parent directory if it doesn't exist
parent
5059654e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
0 deletions
+5
-0
config/serialize.go
config/serialize.go
+5
-0
No files found.
config/serialize.go
View file @
f1e08850
...
...
@@ -22,6 +22,11 @@ func ReadConfigFile(filename string, cfg interface{}) error {
// WriteConfigFile writes the config from `cfg` into `filename`.
func
WriteConfigFile
(
filename
string
,
cfg
interface
{})
error
{
err
:=
os
.
MkdirAll
(
filepath
.
Dir
(
filename
),
0775
)
if
err
!=
nil
{
return
err
}
f
,
err
:=
os
.
Create
(
filename
)
if
err
!=
nil
{
return
err
...
...
This diff is collapsed.
Click to expand it.
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