near / near-cli

General purpose command line tools for interacting with NEAR Protocol
https://docs.near.org
MIT License
193 stars 92 forks source link

New `NEAR_NETWORK` doesn't handle `NEAR_ENV` value #1107

Closed mikedotexe closed 4 months ago

mikedotexe commented 4 months ago

Describe the bug Until a month ago, NEAR CLI has used NEAR_ENV when setting the network, like mainnet and testnet. If folks have differing values on those two environment variables, it will use the old one that's not mentioned in the documentation: https://docs.near.org/tools/near-cli

Screenshot 2024-03-03 at 11 36 46 AM

To Reproduce See screenshot above

Expected behavior As a user, if I follow the NEAR CLI documentation, I should be able to correctly target the network of choice and not have confusion.

Or perhaps this is a simple order of operations where the newly declared environment variable (NEAR_NETWORK) takes precedence over NEAR_ENV.

gagdiez commented 4 months ago

released a new version with a warning message that states NEAR_NETWORK will have precedence over NEAR_ENV, will update the docs to also reflect this