Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed to create configuration directory directory when executing init command if not exist directory #592

Merged
merged 5 commits into from
Sep 11, 2019

Conversation

tomato3713
Copy link
Contributor

If the configuration file directory does not exist,
executing mackerel-agent init -apikey "api key " will return an error with no such file or directory.
So, modified to create a directory if it doesn't exist when executing the above command,
And, add test code for not existing configuration directory.

@tomato3713 tomato3713 changed the title Fixed not found error when configuration file directory does not exist Fixed to create configuration directory directory when it does not exist Sep 9, 2019
@tomato3713 tomato3713 changed the title Fixed to create configuration directory directory when it does not exist Fixed to create configuration directory directory when executing init command if not exist directory Sep 9, 2019
do_init.go Outdated
if !os.IsNotExist(err) {
return err
}
err := os.MkdirAll(root, 0744)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any reason to choose 0744, not 0755?
Currently we use 0755 for newly created directories (explicitly in some cases, or implicitly in many cases). So I prefer 0755 here if there's no special reason.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK. thank you for reviewing

@astj astj merged commit e1242ba into mackerelio:master Sep 11, 2019
@astj astj mentioned this pull request Sep 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants