swiftbar / SwiftBar

Powerful macOS menu bar customization tool
https://swiftbar.app
MIT License
2.93k stars 92 forks source link

":" character in values of environment variables #322

Closed carlosfrodriguez closed 2 years ago

carlosfrodriguez commented 2 years ago

Describe the bug It is not possible to add a value with a ":" character as environment variable

To Reproduce Steps to reproduce the behavior:

  1. Set:

    #  <swiftbar.environment>[SWIFTBAR_TESTPATH:/usr/local/bin:/usr/bin]</swiftbar.environment>

    on any script

  2. Run the script in terminal

There is no such environment variable SWIFTBAR_TESTPATH

Tried with single or double quotes too.

Expected behavior environment variable SWIFTBAR_TESTPATH should be present and show the value including any ":" characters

Environment:

Notes:

Seems like the way you parse this strings always cuts the string where a ":" value is (all occurrences), so you can either let quotes or just stop in the first ":" as you already have another loop for the variable separator ","

melonamin commented 2 years ago

I think changing the syntax from var:val to var=val is the easiest fix and actually makes more sense