alda-lang / alda-core

The core machinery of Alda
80 stars 26 forks source link

Fix launching workers when alda path has spaces #60

Closed Hemaolle closed 6 years ago

Hemaolle commented 6 years ago

The program-path function used to return a path where spaces were URL encoded as '%20a' causing an exception when the server was trying to spawn workers if the alda binary path had spaces, for example if it was placed in the notorious Windows "Program Files" directory.

As mentioned in Stackoverflow: https://stackoverflow.com/questions/320542/how-to-get-the-path-of-a-running-jar-file "The toURI() step is vital to avoid problems with special characters, including spaces and pluses."

This could resolve problems described in issue https://github.com/alda-lang/alda-core/issues/31.

daveyarwood commented 6 years ago

Nice debugging! It seems promising that this will fix the issues in #31.

FWIW, I tried the fix on my Macbook and alda still works normally, with the server able to start workers.

I will push a new version of Alda and see if it resolves #31.