From 3ca0107f1be30d311d7081f7e4185dc3fa78dfa7 Mon Sep 17 00:00:00 2001 From: David Coomber <47242934+dcoomber@users.noreply.github.com> Date: Fri, 11 Aug 2023 19:48:09 +0200 Subject: [PATCH] Proposal to support process.env in Bru script Re #170 --- packages/bruno-js/src/bru.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/bruno-js/src/bru.js b/packages/bruno-js/src/bru.js index b3a84e93..dca3b9ca 100644 --- a/packages/bruno-js/src/bru.js +++ b/packages/bruno-js/src/bru.js @@ -5,6 +5,10 @@ class Bru { this._collectionVariables = collectionVariables; } + getProcessEnv(key) { + return process.env[key]; + } + getEnvVar(key) { return this._envVariables[key]; } @@ -16,7 +20,7 @@ class Bru { // gracefully ignore if key is not present in environment if(!this._envVariables.hasOwnProperty(key)) { - return; + return; } this._envVariables[key] = value; @@ -35,4 +39,4 @@ class Bru { } } -module.exports = Bru; \ No newline at end of file +module.exports = Bru;