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

om init may not preserve file permissions when instantiating templates #429

Open
cameronraysmith opened this issue Feb 28, 2025 · 0 comments

Comments

@cameronraysmith
Copy link

cameronraysmith commented Feb 28, 2025

Briefly, direnv fails after instantiating a template with om init because the template relies on an executable script and the template instantiation doesn't seem to preserve the permissions of the files from the template.

Git-tracked file permissions are not preserved on template instantiation

Steps to reproduce:

Clone the git repo and check script file permissions

❯ git clone https://github.com/sciexp/python-nix-template test-pnt
❯ cd test-pnt
❯ git checkout 7d17d0dbffe756f1804aa86fe95bf61a1867d4d3
❯ ls -alh ./scripts
.rwxr-xr-x user group 838 B Fri Feb 28 22:51:50 2025  set-git-env.sh
❯ stat -c "%a %n" scripts/set-git-env.sh
755 scripts/set-git-env.sh

Use om init to instantiate the template and check file permissions

❯ om init github:sciexp/python-nix-template/7d17d0dbffe756f1804aa86fe95bf61a1867d4d3 -o test-om-pnt
❯ cd test-om-pnt
❯ ls -alh scripts
.rw-r--r-- user group 838 B Wed Dec 31 19:00:01 1969  set-git-env.sh
❯ stat -c "%a %n" scripts/set-git-env.sh
644 scripts/set-git-env.sh

The modification date for scripts/set-git-env.sh has been set to the Unix epoch and the permissions have been changed from 755 to 644.

See ASCII cast from #425 and discussion in #424, #424 (comment) for additional context.

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