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

Handle file permissions #15

Open
michidk opened this issue Jul 25, 2021 · 4 comments
Open

Handle file permissions #15

michidk opened this issue Jul 25, 2021 · 4 comments
Labels
enhancement New feature or request

Comments

@michidk
Copy link
Collaborator

michidk commented Jul 25, 2021

No description provided.

@michidk michidk added the enhancement New feature or request label Jul 26, 2021
@michidk michidk added this to the 1.1.0 milestone Sep 11, 2021
@Shemnei
Copy link
Owner

Shemnei commented Sep 14, 2021

As punktf is platform independent we need to differentiate between unix and windows style permissions.

Draft

My idea would be to have an extra field per dotfile, something like mode, which holds the unix style of file permissions (a u32).

Windows

We would then have to think about a way to translate that to a windows style.
Maybe if only the read/execute groups are set (e.g. 544) we could make the file readonly on windows.
To translate that we would also have to decide which group matters (group, user, other).
I personally would probably pick the user group.

Resources

@michidk
Copy link
Collaborator Author

michidk commented Sep 15, 2021

I wouldn't use that feature if I would have to create a second file for each file that I wanna deploy on Linux. I want to keep it as simple as possible. So I just want a config option in the profile. The feature doesn't matter on windows. Not every feature needs to be available on all platforms, especially when other platforms don't have a certain problem we are trying to fix.

@Shemnei
Copy link
Owner

Shemnei commented Sep 15, 2021

It would be an extra field on a dotfile configuration not file.

Example Profile:

variables:
  OS: "Windows"
dotfiles:
  - path: "scripts/test.sh"
    mode: 755

On a unix machine the mode would be set for the file.
On windows we would set readonly to true as the user group has permissions 5 (r-x).

Another option could be to just ignore this field when running on non-unix machines.

A third option maybe to allow more than just the numeric values.

For example (as regex):

mode: ([0-7]{3}|readonly)

@michidk
Copy link
Collaborator Author

michidk commented Sep 15, 2021

I would vote for ignoring. Not too sure of the implications of the flag.
It's important to me, to be able to set the mode not only for one file, but for multiple files at once (one whole profile).

@Shemnei Shemnei removed this from the 1.1.0 milestone Nov 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants