It seems that -g for declare isn't available on Mac, as it uses Bash 3.2 (and -g is only available at some point in version 4. It's possible to use a newer version through Brew, but also requires playing around with files in /etc and this is a work machine that I really don't want to get to custom with.
Is there a way to modify this plugin to work with Bash 3.2? I'm guessing that some other lines won't work on such an old version of Bash...
EDIT: I've managed to get the plugin working but I've had to change the first line to #!/opt/homebrew/bin/bash and remove the -e argument from realpath. I don't suppose it's worth your time to make any changes, but I may not be the only Mac user that might want this plugin to work. If I have some time I'll have another look at this, and I'll create a PR if I'm successful.
I want to add here that because of the declare -g it also requires bash 4+. MacOS is coming with a 3.2, so that is also something that should maybe be noted somewhere :-).
My work Mac doesn't like this plugin:
It seems that
-g
fordeclare
isn't available on Mac, as it uses Bash 3.2 (and-g
is only available at some point in version 4. It's possible to use a newer version through Brew, but also requires playing around with files in/etc
and this is a work machine that I really don't want to get to custom with.Is there a way to modify this plugin to work with Bash 3.2? I'm guessing that some other lines won't work on such an old version of Bash...
EDIT: I've managed to get the plugin working but I've had to change the first line to
#!/opt/homebrew/bin/bash
and remove the-e
argument fromrealpath
. I don't suppose it's worth your time to make any changes, but I may not be the only Mac user that might want this plugin to work. If I have some time I'll have another look at this, and I'll create a PR if I'm successful.