Skip to content

Commit e1865c3

Browse files
committed
pass options obj to get environment func
1 parent 94ab9a4 commit e1865c3

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

Diff for: node/src/commands/deploy.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ const DeployUtils = require('../lib/deploy-utils');
22
const logger = require('../lib/logger');
33
const { options } = require('../config/constants');
44

5-
const { BLUEPRINT_ID, ENVIRONMENT_NAME, PROJECT_ID, WORKSPACE_NAME } = options;
5+
const { BLUEPRINT_ID, WORKSPACE_NAME } = options;
66

77
const assertBlueprintExistsOnInitialDeployment = options => {
88
if (!options[BLUEPRINT_ID]) throw new Error('Missing blueprint ID on initial deployment');
@@ -26,7 +26,7 @@ const deploy = async (options, variables) => {
2626
const configurationChanges = getConfigurationChanges(variables);
2727

2828
let deployment;
29-
let environment = await deployUtils.getEnvironment(options[ENVIRONMENT_NAME], options[PROJECT_ID]);
29+
let environment = await deployUtils.getEnvironment(options);
3030

3131
if (!environment) {
3232
logger.info('Initial deployment detected!');

Diff for: node/src/commands/destroy.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ const { options } = require('../config/constants');
33
const _ = require('lodash');
44
const { convertStringToBoolean, removeEmptyValuesFromObj } = require('../lib/general-utils');
55

6-
const { PROJECT_ID, ENVIRONMENT_NAME, REQUIRES_APPROVAL, SKIP_STATE_REFRESH } = options;
6+
const { ENVIRONMENT_NAME, REQUIRES_APPROVAL, SKIP_STATE_REFRESH } = options;
77

88
const assertEnvironmentExists = environment => {
99
if (!environment) {
@@ -14,7 +14,7 @@ const assertEnvironmentExists = environment => {
1414
const destroy = async options => {
1515
const deployUtils = new DeployUtils();
1616

17-
const environment = await deployUtils.getEnvironment(options[ENVIRONMENT_NAME], options[PROJECT_ID]);
17+
const environment = await deployUtils.getEnvironment(options);
1818
let status;
1919

2020
assertEnvironmentExists(environment);

Diff for: node/src/lib/set-deployment-approval-status.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const logger = require('../lib/logger');
44
const setDeploymentApprovalStatus = (command, shouldProcessDeploymentSteps) => async options => {
55
const deployUtils = new DeployUtils();
66

7-
const environment = await deployUtils.getEnvironment(options.environmentName, options.projectId);
7+
const environment = await deployUtils.getEnvironment(options);
88

99
if (!environment) {
1010
throw new Error(`Could not find an environment with the name ${options.environmentName}`);

0 commit comments

Comments
 (0)