Skip to content
This repository has been archived by the owner on Oct 4, 2024. It is now read-only.

Commit

Permalink
fix: display warning on duplicated env vars
Browse files Browse the repository at this point in the history
A warning message is shown if NEAR_ENV and NEAR_NETWORK are set
  • Loading branch information
gagdiez authored Mar 4, 2024
2 parents e0bce38 + 4f4d162 commit 15cb2fc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
const DEFAULT_NETWORK = process.env.NEAR_ENV || process.env.NEAR_NETWORK || 'testnet';
const DEFAULT_NETWORK = process.env.NEAR_NETWORK || process.env.NEAR_ENV || 'testnet';

if (process.env.NEAR_NETWORK && process.env.NEAR_ENV){
console.log(`Warning: NEAR_NETWORK and NEAR_ENV are both set! We will use NEAR_NETWORK (${process.env.NEAR_NETWORK})\n`);
}

function getConfig(env) {
let config;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "near-cli",
"version": "4.0.9",
"version": "4.0.10",
"description": "Simple CLI for interacting with NEAR Protocol",
"engines": {
"node": ">= 16"
Expand Down

0 comments on commit 15cb2fc

Please sign in to comment.