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

provide crate fs functions and fix a remove_dir_all bug #129

Merged
merged 3 commits into from
Dec 26, 2023

Conversation

webern
Copy link
Contributor

@webern webern commented Dec 26, 2023

Description of changes:

commit

    fix bug in make.rs

    If a directory does not exist, remove_dir_all will return an error but
    we do not care if the directory does not exist. Ignoring all errors in
    this case is a simple way to ignore the very common case that directory
    does not exist.

commit

    use crate::common::fs instead of tokio::fs

    Convert tokio::fs call sites to use crate::common::fs for better error
    messages. Also fix a case of blocking io.

commit

    add fs functions for better error messages

    Create simple wrapper functions for tokio::fs that provide better error
    messages.

Terms of contribution:

By submitting this pull request, I agree that this contribution is dual-licensed under the terms of both the Apache License, version 2.0, and the MIT license.

Create simple wrapper functions for tokio::fs that provide better error
messages.
Convert tokio::fs call sites to use crate::common::fs for better error
messages. Also fix a case of blocking io.
If a directory does not exist, remove_dir_all will return an error but
we do not care if the directory does not exist. Ignoring all errors in
this case is a simple way to ignore the very common case that directory
does not exist.
Copy link
Contributor

@yeazelm yeazelm left a comment

Choose a reason for hiding this comment

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

LGTM!

@webern webern merged commit 5164b3b into bottlerocket-os:develop Dec 26, 2023
1 check passed
@webern webern deleted the fix-remove-dir branch December 26, 2023 23:01
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.

3 participants