SwiftBar icon indicating copy to clipboard operation
SwiftBar copied to clipboard

":" character in values of environment variables

Open carlosfrodriguez opened this issue 3 years ago • 1 comments

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

  1. 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:

  • macOS version: 12.4
  • SwiftBar version: 1.4.3

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 ","

carlosfrodriguez avatar May 23 '22 16:05 carlosfrodriguez

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

melonamin avatar Jul 17 '22 23:07 melonamin