server-for-symfony-flex icon indicating copy to clipboard operation
server-for-symfony-flex copied to clipboard

Fixed executable determination

Open leonboot opened this issue 4 years ago • 2 comments

I noticed that when copying files from the recipe that have the executable bit set, this bit was lost after copying. The cause was that the filename used for determining whether the executable flag was set was a concatenation of the recipe path and the relative filename. However, there was no directory separator, so the path to the file was always invalid and thus the executable flag was always set to false.

I changed the code to use the absolute path to the file instead of a concatenation of the recipe path and the relative path to the file.

leonboot avatar Aug 03 '21 08:08 leonboot

Another option would be to add a DIRECTORY_SEPARATOR between the recipe path and the relative file path, but I chose to use SplFileInfo->getPathname() method to get the absolute path to the file.

leonboot avatar Aug 03 '21 09:08 leonboot

@moay did you get around to look at this PR yet? I believe it fixes a bug which prevents authors of recipes from adding executable scripts to the bin/ directory, since the executable bit on these scripts is lost.

leonboot avatar Jun 21 '22 10:06 leonboot