You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the .travis.yml file export works as it normally would in bash. declare does not seem to do the same. I've tried using 'declare -x' to export the variable and declare followed by export, but this does not work. What is happening to stop this working properly? It's as if each line in the .travis.yml is run in a new shell, except this can't be the case as more usual setting of variables with export do work.
Here are some experiments I did using this .travis.yml:
So export TESTER1 works and the rest only work on the one line and not on the next line of the .travis.yml file. I can move this logic into a script to workaround it, but I'm intrigued as to why it does not work.
Why do I want to use declare instead of simple variables? Well, I would really like to use 'declare -A' for associative arrays.
The text was updated successfully, but these errors were encountered:
Under the hood, each item in the script sequence is passed a Bash function so that we can write logs in an informative way. This is bad news for declare, since the scope of the variables defined therein is restricted to the Bash function.
I see what you want to accomplish, but this is not simply possible with the current implementation.
In the .travis.yml file export works as it normally would in bash. declare does not seem to do the same. I've tried using 'declare -x' to export the variable and declare followed by export, but this does not work. What is happening to stop this working properly? It's as if each line in the .travis.yml is run in a new shell, except this can't be the case as more usual setting of variables with export do work.
Here are some experiments I did using this .travis.yml:
and output on Travis:
So export TESTER1 works and the rest only work on the one line and not on the next line of the .travis.yml file. I can move this logic into a script to workaround it, but I'm intrigued as to why it does not work.
Why do I want to use declare instead of simple variables? Well, I would really like to use 'declare -A' for associative arrays.
The text was updated successfully, but these errors were encountered: