yonaskolb / Beak

A command line interface for your Swift scripts

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Edit command removes file attributes

Jerrot opened this issue · comments

After using beak edit and the final progress of copying the file back, the file attributes are lost. This is a little disturbing if you want to use the Shebang way to run your script, because you always need to execute the chmod again.

You’re right. We could either fix that by copying the files back and forth instead of the writing from scratch that happens, or automatically set permissions on files with shebangs

Setting permissions automatically might be a source of unwanted security issues IMHO, people might be surprised to find their files executable on base of the content, if they decided to not set the flag yet before.

Copying sounds fine to me. I didn't dive deep enough into SwiftPM (and Beak) though to provide a patch/pr myself (yet) though.

@yonaskolb Any plans on fixing this (or any other Beak issue) currently? This project looks like it's not being maintained anymore ... I'd be glad to help if you don't have the time. Just make me a maintainer and I'll try to update the project without any breaking changes as good as I can.