Well, I'm setting or adjusting that variable 'CORDOVA_BBTOOLS', because is used by a file called 'target-utils.js', which belongs to the blackberry library, if it were my call, I rather to use just the path with what I need to do, instead of set a variable, but to do so I need to modify the logic in the blackberry library, that's why I'm doing it in that way.
target-utils.js reference.
https://github.com/apache/cordova-blackberry/blob/master/blackberry10/bin/templates/project/cordova/lib/target-utils.js#L86
https://github.com/apache/cordova-blackberry/blob/master/blackberry10/bin/templates/project/cordova/lib/target-utils.js#L247
I'm using that file, which contains logic to get some information, instead of duplicate code, I'm adjusting my program to it.
I know that shelljs.which it looks for the for an exe, bat, or cmd file in the whole path, which is really good, I've create my own function because I didn't know about shelljs.which.
get_pathEnv, it gets the Env path, and it looks for files which should be located in that path.
https://github.com/martincgg/cordova-cli/blob/CB-5082/src/info-utils.js#L125
Those files it can be sent in an array:
https://github.com/martincgg/cordova-cli/blob/CB-5082/src/info-utils.js#L49
In the code, I've set two files as you can see in the line, I just want to make sure that is the right file.
determine_Env_Var it only looks if the variable is set or not, just that.

Here, I determine if the variable is currently set:
https://github.com/martincgg/cordova-cli/blob/CB-5082/src/info-utils.js#L118
If that variable is already set, I'm not going to touch it.
Here, is deciding if is going to be erased or not:
https://github.com/martincgg/cordova-cli/blob/CB-5082/src/info-utils.js#L62
If the variable it was set before the program executions, is not going to erase it, but if it was set just to execute this js file, is going to erase it in order to not affect or impact in any other process.
Here's going to delete the variable
https://github.com/martincgg/cordova-cli/blob/CB-5082/src/info-utils.js#L102
Is going to unset the variable.
Most of those functions, I've added them like part of the object, because it can useful for another js file.
Well, Andrew what are my options with this, go to blackberry library and change the target-utils.js file and set that instead of use an environmental variable it uses just the path, and also set the function to accept an argument as the path?