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

Improve with_file API when there is no source file #177

Open
olivierlemasle opened this issue Sep 26, 2023 · 0 comments
Open

Improve with_file API when there is no source file #177

olivierlemasle opened this issue Sep 26, 2023 · 0 comments

Comments

@olivierlemasle
Copy link
Collaborator

Symbolic link files are added like this (since #168):

.with_file(
    "./test_assets/empty_file_for_symlink_create",
    FileOptions::new("/usr/bin/awesome_link")
        .mode(0o120644)
)?

However, the empty file is needed just to get its last modification timestamp, and to comply with with_file(source, options) API.

To add a directory (cf #12), it is also possible to do:

.with_file(
    "./test_assets/empty_file",
    FileOptions::new("/usr/share/awesome")
        .mode(FileMode::Dir { permissions: 0o755 }), // or .mode(0o040755)
)?

However, in both cases, it feels weird to require a file, whose content is not used.

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

No branches or pull requests

1 participant