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

Symlink & File Permission Support? #89

Open
coolaj86 opened this issue Oct 23, 2020 · 1 comment
Open

Symlink & File Permission Support? #89

coolaj86 opened this issue Oct 23, 2020 · 1 comment

Comments

@coolaj86
Copy link

coolaj86 commented Oct 23, 2020

It appears that the default behavior is to strip the Mode and file permission bits and to read symlink targets rather than to save the path as the contents.

I suppose this could be circumvented by first running tar and then running vfsgen, or running some other process to save the metadata and zipping it together later.

I couldn't find any issues or docs about either symlinks or file permissions.

Is this explicitly not a goal of the project? Or just an oversight?

Why?

I'm working on a project that has an init subcommand which generates project files, including a .env.

# initializes .env and the ./scripts/ directory
gitdeploy init

# run with the default configuration
gitdeploy run
@dmitshur
Copy link
Member

I couldn't find any issues or docs about either symlinks or file permissions.

Is this explicitly not a goal of the project? Or just an oversight?

This is a good question, thanks for asking.

I've never run into a need for preserving custom file permissions (beyond the directory vs file distinction), and so I didn't implement it.

I also prefer to keep this project as simple and portable as possible. Symlinks and file permissions are not the most portable concepts: some OSes support them one way, others in another way, and some not at all. A virtual filesystem generated on one OS should be usable by a program running on another OS.

I suspect preserving file mode is doable, as it's just an uint32. But it's worth thinking about carefully if it should be done, and if there should be any restrictions on allowed values.

I'm less sure about what it would mean to support symlinks. Go's upcoming support for embedded files won't support it either.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants