Skip to content

Commit 9585237

Browse files
authored
fix(environments): fix deploying to production (#16)
* fix(environments): fix deploying to production When no domain suffix is set we should deploy to production. Similarly we should handle the lookup of the right environment which was broken til now * fix(client): adjust message for bare enviroments
1 parent 612a529 commit 9585237

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

Diff for: src/api/environments.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ export async function createEnvironmentFromSuffix(
6666
form: true,
6767
body: {
6868
UniqueName: uniqueName,
69-
DomainSuffix: domainSuffix,
69+
DomainSuffix: domainSuffix || undefined,
7070
// this property currently doesn't exist but for the future lets set it
7171
FriendlyName: `${uniqueName} Environment (Created by CLI)`,
7272
},
@@ -105,7 +105,9 @@ export async function getEnvironmentFromSuffix(
105105
): Promise<EnvironmentResource> {
106106
const environments = await listEnvironments(serviceSid, client);
107107
let foundEnvironments = environments.filter(
108-
e => e.domain_suffix === domainSuffix
108+
e =>
109+
e.domain_suffix === domainSuffix ||
110+
(domainSuffix.length === 0 && e.domain_suffix === null)
109111
);
110112

111113
let env: EnvironmentResource | undefined;

Diff for: src/client.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,9 @@ export class TwilioServerlessApiClient extends events.EventEmitter {
347347

348348
this.emit('status-update', {
349349
status: DeployStatus.CONFIGURING_ENVIRONMENT,
350-
message: `Configuring "${config.functionsEnv}" environment`,
350+
message: `Configuring ${
351+
config.functionsEnv.length === 0 ? 'bare' : `"${config.functionsEnv}"`
352+
} environment`,
351353
});
352354
const environment = await createEnvironmentIfNotExists(
353355
config.functionsEnv,

0 commit comments

Comments
 (0)