File tree Expand file tree Collapse file tree 2 files changed +25
-0
lines changed
packages/cli/src/cli/utils Expand file tree Collapse file tree 2 files changed +25
-0
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " lingo.dev " : patch
3+ ---
4+
5+ warn if env vars override values from "auth --login"
Original file line number Diff line number Diff line change @@ -14,6 +14,8 @@ export function getSettings(explicitApiKey: string | undefined): CliSettings {
1414
1515 _legacyEnvVarWarning ( ) ;
1616
17+ _envVarsWarning ( ) ;
18+
1719 return {
1820 auth : {
1921 apiKey : explicitApiKey || env . LINGODOTDEV_API_KEY || systemFile . auth ?. apiKey || defaults . auth . apiKey ,
@@ -102,3 +104,21 @@ Please use LINGODOTDEV_API_KEY instead.
102104 ) ;
103105 }
104106}
107+
108+ function _envVarsWarning ( ) {
109+ const env = _loadEnv ( ) ;
110+ const systemFile = _loadSystemFile ( ) ;
111+
112+ if ( env . LINGODOTDEV_API_KEY && systemFile . auth ?. apiKey ) {
113+ console . warn (
114+ "\x1b[33m%s\x1b[0m" ,
115+ `⚠️ WARNING: Using LINGODOTDEV_API_KEY env var instead of credentials from login flow (saved in .lingodotdevrc)` ,
116+ ) ;
117+ }
118+ if ( env . LINGODOTDEV_API_URL ) {
119+ console . warn ( "\x1b[33m%s\x1b[0m" , `⚠️ WARNING: Using LINGODOTDEV_API_URL: ${ env . LINGODOTDEV_API_URL } ` ) ;
120+ }
121+ if ( env . LINGODOTDEV_WEB_URL ) {
122+ console . warn ( "\x1b[33m%s\x1b[0m" , `⚠️ WARNING: Using LINGODOTDEV_WEB_URL: ${ env . LINGODOTDEV_WEB_URL } ` ) ;
123+ }
124+ }
You can’t perform that action at this time.
0 commit comments