cyverse / gocommands

iRODS Command-line Tools written in Go
Other
29 stars 18 forks source link

Two irods environments --config option #32

Closed jjkoehorst closed 5 months ago

jjkoehorst commented 5 months ago

I wanted to switch from one environment to another but the -c option is ignored?

gocmd init --config ~/.irods_wur/irods_wur.json iRODS Host [unlock-icat.irods.surfsara.nl]:

While the content of this is

"irods_host": "scomp0000.wurnet.nl",

does $IRODS_HOST take over when that is set? Not sure what the official order was nowadays when you explicitly give a config file.

jjkoehorst commented 5 months ago

Should have checked indeed $IRODS_HOST takes over... is that preferred?

iychoi commented 5 months ago

capture1

the -c or --config flag actually reads config from the file given. Can you double check if it really is an issue?

jjkoehorst commented 5 months ago

Did you try with setting IRODS_HOST to something else?

iychoi commented 5 months ago

The result above didn't set any environmental variables.

capture2

If I set the environmental varaible IRODS_HOST, it will overwrite configuration provided. Environmental variables have the highest priority setting configuration values in iCommands and GoCommands.

jjkoehorst commented 5 months ago

Yeah I wanted to double check

is then not the case but it is

then I just need to make sure I unset system variables on a local device when working with multiple config files. Thanks!

iychoi commented 5 months ago

Yes, the priority was set to address this issue.

https://github.com/cyverse/gocommands/issues/23

Thanks for testing.