Skip to content

Commit 486ae73

Browse files
committed
fix(deploy): improve deploy output of private assets
This will print private assets not anylonger with a URL but with Runtime.getAssets()[path]. It also prints the headline now to stderr
1 parent a79ea58 commit 486ae73

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

src/printers/deploy.ts

+11-5
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,11 @@ function prettyPrintConfigInfo(config: DeployLocalProjectConfig) {
7474
dependencyString = Object.keys(config.pkgJson.dependencies).join(', ');
7575
}
7676

77+
process.stderr.write(
78+
'\nDeploying functions & assets to the Twilio Runtime\n'
79+
);
7780
console.log(
7881
chalk`
79-
Deploying functions & assets to Twilio Serverless
80-
8182
{bold.cyan Account}\t\t${config.accountSid}
8283
{bold.cyan Token}\t\t${redactPartOfString(config.authToken)}
8384
{bold.cyan Service Name}\t${config.serviceName}
@@ -121,6 +122,7 @@ function prettyPrintDeployedResources(
121122
${result.buildSid}
122123
`.trim()
123124
);
125+
124126
if (result.functionResources) {
125127
const functionMessage = result.functionResources
126128
.sort(sortByAccess)
@@ -137,10 +139,14 @@ function prettyPrintDeployedResources(
137139
if (result.assetResources) {
138140
const assetMessage = result.assetResources
139141
.sort(sortByAccess)
140-
.map(fn => {
142+
.map(asset => {
141143
const accessPrefix =
142-
fn.access !== 'public' ? chalk`{bold [${fn.access}]} ` : '';
143-
return chalk` ${accessPrefix}{dim https://${result.domain}}${fn.path}`;
144+
asset.access !== 'public' ? chalk`{bold [${asset.access}]} ` : '';
145+
const accessUrl =
146+
asset.access === 'private'
147+
? chalk`{dim Runtime.getAssets()['}${asset.path}{dim ']}`
148+
: chalk`{dim https://${result.domain}}${asset.path}`;
149+
return ` ${accessPrefix}${accessUrl}`;
144150
})
145151
.join('\n');
146152

0 commit comments

Comments
 (0)