Skip to content

Commit

Permalink
Remove sonar issue
Browse files Browse the repository at this point in the history
  • Loading branch information
AayushSaini101 committed Dec 10, 2024
1 parent daac2a6 commit bd99245
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
14 changes: 7 additions & 7 deletions src/commands/config/proxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import Command from '../../core/base';
import {proxyFlags} from '../../core/flags/config/proxy.flags';

export default class Proxy extends Command {
static description = 'Add the proxy support in the CLI.';
static readonly description = 'Add the proxy support in the CLI.';

static flags = proxyFlags();
static readonly flags = proxyFlags();

async run() {
const { flags } = await this.parse(Proxy); //NOSONAR
Expand All @@ -17,23 +17,23 @@ export default class Proxy extends Command {
if (http_proxy) {
process.env.http_proxy = http_proxy;
this.log(
'http_proxy has been succesfully added in the CLI} ✅',
'http_proxy has been succesfully added in the CLI✅',
);
}
if (https_proxy) {
process.env.https_proxy = https_proxy;
this.log(
'https_proxy has been succesfully added in the CLI} ✅',
'https_proxy has been succesfully added in the CLI✅',
);
}

this.log(`http_proxy: ${process.env.http_proxy}`);
this.log(`https_proxy: ${process.env.https_proxy}`);
// Removing all proxies if `--no_proxy` is provided
if (no_proxy) {
delete process.env.http_proxy;
delete process.env.https_proxy;

this.log(
'All the proxies has been removed from the CLI } ✅',
'All the proxies has been removed from the CLI ✅',
);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/core/flags/config/proxy.flags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export const proxyFlags = () => {
help: Flags.help({ char: 'h' }),
http_proxy: Flags.string({ string: 'http_proxy', description: 'add http_proxy', default: '' }),
https_proxy: Flags.string({ string: 'https_proxy', description: 'add https_proxy', default: '' }),
no_proxy: Flags.string({ string: 'no_proxy', description: 'remove all the proxies from the env' }),
no_proxy: Flags.boolean({ description: 'Remove all the proxies from the environment', default: false }),

};
};
Expand Down
Empty file.

0 comments on commit bd99245

Please sign in to comment.