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

fix: create file before put content to it #71

Merged
merged 5 commits into from
Feb 13, 2025

Conversation

luohoufu
Copy link
Contributor

@luohoufu luohoufu commented Jan 23, 2025

What does this PR do

This pull request includes changes to the SaveConfigStr function in the modules/configs/config/config.go file to improve error handling and ensure the configuration directory exists before saving the configuration file.

Improvements to error handling and directory creation:

Rationale for this change

Standards checklist

  • The PR title is descriptive
  • The commit messages are semantic
  • Necessary tests are added
  • Updated the release notes
  • Necessary documents have been added if this is a new feature
  • Performance tests checked, no obvious performance degradation

@luohoufu luohoufu requested review from medcl and silenceqi January 23, 2025 01:49
@@ -138,6 +137,11 @@ func SaveConfigStr(name, content string) error {
}
}

_, err = util.CreateFile(cfgDir, "")
Copy link
Member

Choose a reason for hiding this comment

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

create a file with cfDir?
better to use os.mkdirall instead i guess

Copy link
Contributor

Choose a reason for hiding this comment

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

let me change it.

@luohoufu luohoufu merged commit 9bd8d1c into main Feb 13, 2025
5 checks passed
@luohoufu luohoufu deleted the fix_client_folder_auto_create_pr branch February 13, 2025 09:31
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.

4 participants