JanDeDobbeleer / aliae

Cross shell and platform alias management
https://aliae.dev
MIT License
73 stars 3 forks source link

feat: env array #102

Closed kiliantyler closed 2 months ago

kiliantyler commented 3 months ago

Prerequisites

This PR allows for environment variables to be exported as an Array. A common use case in zsh (and I'm sure other shells) is to have an array set up for exclusions or inclusions. Specifically for things like the zsh plugin YouShouldUse. These require an array ENV=("content") and this was incompatible with the current formatString.

I am marking this as a Draft since only zsh and bash have been implemented directly. I have almost zero knowledge of the other shells Aliae supports and figured if they have functional arrays adding them wouldn't be too difficult for someone who does use them. If not I can go digging around in their docs to get them added. I am also unsure if Type should be a string that would allow future expansion of other types, or if the option should just be Array and be a boolean.

Shell Array Support Complete Tests
Cmd ⛔️
Bash
Fish
(all vars are arrays)
Nu
Pwsh
Tcsh ⛔️
(arrays exist but not for setenv)
Xonsh
Zsh
kiliantyler commented 2 months ago

This should be good to go, all of the currently supported shells that also support Arrays (or lists) have an option to export their Env as an array 🎉