GitPortable icon indicating copy to clipboard operation
GitPortable copied to clipboard

Can't Access Environment Variables with non ASCII characters [a-zA-Z0-9_]

Open LeonT-A opened this issue 3 years ago • 1 comments

While trying to customize my .bashrc/.bash_profile, I was unable to retrieve the values from environment variables that included :, such as...

PAL:Drive=V:
PAL:DriveLetter=V

I tried various different quotes and {} methods, but none of them worked. These variables are incredibly useful for things like adding directories to the $PATH and for creating custom variables to be used in programs launched from the terminal.

Is there no way to access the value of these variables from within Git-Bash/.sh? At the moment, my best solution is to parse the variables that are ASCII compliant. So to get the portable drive litter, I would do...

PORTABLE_DRIVE=${HOME:1:1}

LeonT-A avatar Sep 15 '20 21:09 LeonT-A

To do what you're looking for, you'll need to edit the GitPortable/App/Appinfo/Launcher/GitBashPortable.ini file

[Environment]
HOME=%PAL:DataDir%\home
PORTABLE_DRIVE=%PAL:Drive%

jgonyea avatar Jan 04 '21 20:01 jgonyea