asdf-vm / asdf-nodejs

Node.js plugin for asdf version manager
https://github.com/asdf-vm/asdf
MIT License
908 stars 144 forks source link

Force compile flag has a typo #364

Closed bitboxer closed 1 year ago

bitboxer commented 1 year ago

I think the - after ASDF_NODEJS_FORCE_COMPILE is wrong. When I remove it, it forces compilation. With it, it does not:

https://github.com/asdf-vm/asdf-nodejs/blob/4f8aa3d9ebeb626c6905f6456c5ded13b06b59ab/bin/install#L14

Stratus3D commented 1 year ago

My guess is this should be:

... [ "${ASDF_NODEJS_FORCE_COMPILE:-}" ]; ...

The ${VAR:-} is a common pattern when VAR may be undefined.

Stratus3D commented 1 year ago

@augustobmoura can you take a look at this?

augustobmoura commented 1 year ago

Not a typo, the ${variable-word} expansion means that word will be expanded if and only if the variable is unset, the ${variable:-word} syntax means that word will be expanded if the variable is unset or is an empty value.

On this case we only need to check for unset, as we are trying to avoid an error of referencing unset variables