sparkle-project / Sparkle

A software update framework for macOS
https://sparkle-project.org
Other
7.37k stars 1.05k forks source link

Can't use Process Substitution for `generate_appcast --ed-key-file` #2605

Closed zorgiepoo closed 2 weeks ago

zorgiepoo commented 1 month ago

Discussed in https://github.com/sparkle-project/Sparkle/discussions/2602

Originally posted by **kevincox** July 30, 2024 ## Summary ``` % generate_appcast --ed-key-file <(echo mysecretkey) example/ Unable to load EdDSA private key from /dev/fd/11 Error Domain=NSCocoaErrorDomain Code=257 "The file “11” couldn’t be opened because you don’t have permission to view it." UserInfo={NSFilePath=/dev/fd/11, NSUnderlyingError=0x6000002404e0 {Error Domain=NSPOSIXErrorDomain Code=13 "Permission denied"}} ``` You can work around this by using stdin. (Example doesn't have a real key, but with a real key everything works perfectly.) ``` % echo mysecretkey | generate_appcast --ed-key-file - example/ Error: Private key not found in the argument. Please provide a valid key. ``` This is very surprising as it should just be reading from the passed in path. For some reason it doesn't work properly. Not only is this surprising and leads to requiring a different approach but in many cases the stdin approach results in scripts that are harder to read and maintian. ## Version 2.6.4
zorgiepoo commented 1 month ago

Need to use FileHandle to read contents of file