Skip to content

Commit 0be0237

Browse files
fix issue #33
1 parent 0296b08 commit 0be0237

File tree

3 files changed

+35
-30
lines changed

3 files changed

+35
-30
lines changed

README.md

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ OPTIONS
108108
-s, --schema=schema (required) [default: templates] path to schema file
109109
```
110110

111-
_See code: [src/commands/autopilot/create.js](https://github.com/dabblelab/twilio-cli-autopilot-plugin/blob/v1.0.2/src/commands/autopilot/create.js)_
111+
_See code: [src/commands/autopilot/create.js](https://github.com/dabblelab/twilio-cli-autopilot-plugin/blob/v1.0.3-beta.0/src/commands/autopilot/create.js)_
112112

113113
## `twilio autopilot:delete`
114114

@@ -124,7 +124,7 @@ OPTIONS
124124
--unique-name=unique-name assistant unique name
125125
```
126126

127-
_See code: [src/commands/autopilot/delete.js](https://github.com/dabblelab/twilio-cli-autopilot-plugin/blob/v1.0.2/src/commands/autopilot/delete.js)_
127+
_See code: [src/commands/autopilot/delete.js](https://github.com/dabblelab/twilio-cli-autopilot-plugin/blob/v1.0.3-beta.0/src/commands/autopilot/delete.js)_
128128

129129
## `twilio autopilot:export`
130130

@@ -140,7 +140,7 @@ OPTIONS
140140
--unique-name=unique-name assistant unique name
141141
```
142142

143-
_See code: [src/commands/autopilot/export.js](https://github.com/dabblelab/twilio-cli-autopilot-plugin/blob/v1.0.2/src/commands/autopilot/export.js)_
143+
_See code: [src/commands/autopilot/export.js](https://github.com/dabblelab/twilio-cli-autopilot-plugin/blob/v1.0.3-beta.0/src/commands/autopilot/export.js)_
144144

145145
## `twilio autopilot:list`
146146

@@ -156,7 +156,7 @@ OPTIONS
156156
https://www.twilio.com/docs/autopilot/api/assistant#assistant-properties
157157
```
158158

159-
_See code: [src/commands/autopilot/list.js](https://github.com/dabblelab/twilio-cli-autopilot-plugin/blob/v1.0.2/src/commands/autopilot/list.js)_
159+
_See code: [src/commands/autopilot/list.js](https://github.com/dabblelab/twilio-cli-autopilot-plugin/blob/v1.0.3-beta.0/src/commands/autopilot/list.js)_
160160

161161
## `twilio autopilot:update`
162162

@@ -172,7 +172,7 @@ OPTIONS
172172
--unique-name=unique-name assistant unique name
173173
```
174174

175-
_See code: [src/commands/autopilot/update.js](https://github.com/dabblelab/twilio-cli-autopilot-plugin/blob/v1.0.2/src/commands/autopilot/update.js)_
175+
_See code: [src/commands/autopilot/update.js](https://github.com/dabblelab/twilio-cli-autopilot-plugin/blob/v1.0.3-beta.0/src/commands/autopilot/update.js)_
176176

177177
## `twilio autopilot:init`
178178

@@ -190,7 +190,7 @@ OPTIONS
190190
--url=url the url to the template list or the git repo
191191
```
192192

193-
_See code: [src/commands/autopilot/init.js](https://github.com/dabblelab/twilio-cli-autopilot-plugin/blob/v1.0.2/src/commands/autopilot/init.js)_
193+
_See code: [src/commands/autopilot/init.js](https://github.com/dabblelab/twilio-cli-autopilot-plugin/blob/v1.0.3-beta.0/src/commands/autopilot/init.js)_
194194

195195
## `twilio autopilot:deploy`
196196

@@ -210,7 +210,7 @@ OPTIONS
210210
--override-existing-project Deploys Serverless project to existing service if a naming conflict has been found.
211211
```
212212

213-
_See code: [src/commands/autopilot/deploy.js](https://github.com/dabblelab/twilio-cli-autopilot-plugin/blob/v1.0.2/src/commands/autopilot/deploy.js)_
213+
_See code: [src/commands/autopilot/deploy.js](https://github.com/dabblelab/twilio-cli-autopilot-plugin/blob/v1.0.3-beta.0/src/commands/autopilot/deploy.js)_
214214

215215
## `twilio autopilot:fields:create`
216216

@@ -233,7 +233,7 @@ OPTIONS
233233
--unique-name=unique-name (required) field unique name
234234
```
235235

236-
_See code: [src/commands/autopilot/fields/create.js](https://github.com/dabblelab/twilio-cli-autopilot-plugin/blob/v1.0.2/src/commands/autopilot/fields/create.js)_
236+
_See code: [src/commands/autopilot/fields/create.js](https://github.com/dabblelab/twilio-cli-autopilot-plugin/blob/v1.0.3-beta.0/src/commands/autopilot/fields/create.js)_
237237

238238
## `twilio autopilot:fields:delete`
239239

@@ -252,7 +252,7 @@ OPTIONS
252252
--task-sid=task-sid task sid
253253
```
254254

255-
_See code: [src/commands/autopilot/fields/delete.js](https://github.com/dabblelab/twilio-cli-autopilot-plugin/blob/v1.0.2/src/commands/autopilot/fields/delete.js)_
255+
_See code: [src/commands/autopilot/fields/delete.js](https://github.com/dabblelab/twilio-cli-autopilot-plugin/blob/v1.0.3-beta.0/src/commands/autopilot/fields/delete.js)_
256256

257257
## `twilio autopilot:fields:list`
258258

@@ -270,7 +270,7 @@ OPTIONS
270270
--task-sid=task-sid task sid
271271
```
272272

273-
_See code: [src/commands/autopilot/fields/list.js](https://github.com/dabblelab/twilio-cli-autopilot-plugin/blob/v1.0.2/src/commands/autopilot/fields/list.js)_
273+
_See code: [src/commands/autopilot/fields/list.js](https://github.com/dabblelab/twilio-cli-autopilot-plugin/blob/v1.0.3-beta.0/src/commands/autopilot/fields/list.js)_
274274

275275
## `twilio autopilot:fieldtypes:create`
276276

@@ -287,7 +287,7 @@ OPTIONS
287287
--unique-name=unique-name (required) unique name for the field type
288288
```
289289

290-
_See code: [src/commands/autopilot/fieldtypes/create.js](https://github.com/dabblelab/twilio-cli-autopilot-plugin/blob/v1.0.2/src/commands/autopilot/fieldtypes/create.js)_
290+
_See code: [src/commands/autopilot/fieldtypes/create.js](https://github.com/dabblelab/twilio-cli-autopilot-plugin/blob/v1.0.3-beta.0/src/commands/autopilot/fieldtypes/create.js)_
291291

292292
## `twilio autopilot:fieldtypes:list`
293293

@@ -304,7 +304,7 @@ OPTIONS
304304
https://www.twilio.com/docs/autopilot/api/field-type#fieldtype-properties
305305
```
306306

307-
_See code: [src/commands/autopilot/fieldtypes/list.js](https://github.com/dabblelab/twilio-cli-autopilot-plugin/blob/v1.0.2/src/commands/autopilot/fieldtypes/list.js)_
307+
_See code: [src/commands/autopilot/fieldtypes/list.js](https://github.com/dabblelab/twilio-cli-autopilot-plugin/blob/v1.0.3-beta.0/src/commands/autopilot/fieldtypes/list.js)_
308308

309309
## `twilio autopilot:fieldtypes:update`
310310

@@ -322,7 +322,7 @@ OPTIONS
322322
--unique-name=unique-name field unique name
323323
```
324324

325-
_See code: [src/commands/autopilot/fieldtypes/update.js](https://github.com/dabblelab/twilio-cli-autopilot-plugin/blob/v1.0.2/src/commands/autopilot/fieldtypes/update.js)_
325+
_See code: [src/commands/autopilot/fieldtypes/update.js](https://github.com/dabblelab/twilio-cli-autopilot-plugin/blob/v1.0.3-beta.0/src/commands/autopilot/fieldtypes/update.js)_
326326

327327
## `twilio autopilot:fieldvalues:upload`
328328

@@ -339,7 +339,7 @@ OPTIONS
339339
--file-name=file-name (required) a CSV file of field values (one on each row with synonyms in columns)
340340
```
341341

342-
_See code: [src/commands/autopilot/fieldvalues/upload.js](https://github.com/dabblelab/twilio-cli-autopilot-plugin/blob/v1.0.2/src/commands/autopilot/fieldvalues/upload.js)_
342+
_See code: [src/commands/autopilot/fieldvalues/upload.js](https://github.com/dabblelab/twilio-cli-autopilot-plugin/blob/v1.0.3-beta.0/src/commands/autopilot/fieldvalues/upload.js)_
343343

344344
## `twilio autopilot:tasks:create`
345345

@@ -356,7 +356,7 @@ OPTIONS
356356
--unique-name=unique-name (required) unique name for task
357357
```
358358

359-
_See code: [src/commands/autopilot/tasks/create.js](https://github.com/dabblelab/twilio-cli-autopilot-plugin/blob/v1.0.2/src/commands/autopilot/tasks/create.js)_
359+
_See code: [src/commands/autopilot/tasks/create.js](https://github.com/dabblelab/twilio-cli-autopilot-plugin/blob/v1.0.3-beta.0/src/commands/autopilot/tasks/create.js)_
360360

361361
## `twilio autopilot:tasks:delete`
362362

@@ -372,7 +372,7 @@ OPTIONS
372372
--task-sid=task-sid task sid
373373
```
374374

375-
_See code: [src/commands/autopilot/tasks/delete.js](https://github.com/dabblelab/twilio-cli-autopilot-plugin/blob/v1.0.2/src/commands/autopilot/tasks/delete.js)_
375+
_See code: [src/commands/autopilot/tasks/delete.js](https://github.com/dabblelab/twilio-cli-autopilot-plugin/blob/v1.0.3-beta.0/src/commands/autopilot/tasks/delete.js)_
376376

377377
## `twilio autopilot:tasks:list`
378378

@@ -389,7 +389,7 @@ OPTIONS
389389
https://www.twilio.com/docs/autopilot/api/task#task-properties
390390
```
391391

392-
_See code: [src/commands/autopilot/tasks/list.js](https://github.com/dabblelab/twilio-cli-autopilot-plugin/blob/v1.0.2/src/commands/autopilot/tasks/list.js)_
392+
_See code: [src/commands/autopilot/tasks/list.js](https://github.com/dabblelab/twilio-cli-autopilot-plugin/blob/v1.0.3-beta.0/src/commands/autopilot/tasks/list.js)_
393393

394394
## `twilio autopilot:tasks:update`
395395

@@ -407,7 +407,7 @@ OPTIONS
407407
--unique-name=unique-name task unique name to update
408408
```
409409

410-
_See code: [src/commands/autopilot/tasks/update.js](https://github.com/dabblelab/twilio-cli-autopilot-plugin/blob/v1.0.2/src/commands/autopilot/tasks/update.js)_
410+
_See code: [src/commands/autopilot/tasks/update.js](https://github.com/dabblelab/twilio-cli-autopilot-plugin/blob/v1.0.3-beta.0/src/commands/autopilot/tasks/update.js)_
411411

412412
## `twilio autopilot:samples:upload`
413413

@@ -424,7 +424,7 @@ OPTIONS
424424
--task-sid=task-sid task sid
425425
```
426426

427-
_See code: [src/commands/autopilot/samples/upload.js](https://github.com/dabblelab/twilio-cli-autopilot-plugin/blob/v1.0.2/src/commands/autopilot/samples/upload.js)_
427+
_See code: [src/commands/autopilot/samples/upload.js](https://github.com/dabblelab/twilio-cli-autopilot-plugin/blob/v1.0.3-beta.0/src/commands/autopilot/samples/upload.js)_
428428

429429
## `twilio autopilot:import [TYPE]`
430430

@@ -451,7 +451,7 @@ DESCRIPTION
451451
-> twilio autopilot:import alexa --model <alexa-interaction-model-file> [--redirectURL <alexa-back-end-hanlder-url>]
452452
```
453453

454-
_See code: [src/commands/autopilot/import.js](https://github.com/dabblelab/twilio-cli-autopilot-plugin/blob/v1.0.2/src/commands/autopilot/import.js)_
454+
_See code: [src/commands/autopilot/import.js](https://github.com/dabblelab/twilio-cli-autopilot-plugin/blob/v1.0.3-beta.0/src/commands/autopilot/import.js)_
455455

456456
## `twilio autopilot:webhooks:create`
457457

@@ -470,7 +470,7 @@ OPTIONS
470470
-w, --webhook-unique-name=webhook-unique-name (required) unique name for webhook
471471
```
472472

473-
_See code: [src/commands/autopilot/webhooks/create.js](https://github.com/dabblelab/twilio-cli-autopilot-plugin/blob/v1.0.2/src/commands/autopilot/webhooks/create.js)_
473+
_See code: [src/commands/autopilot/webhooks/create.js](https://github.com/dabblelab/twilio-cli-autopilot-plugin/blob/v1.0.3-beta.0/src/commands/autopilot/webhooks/create.js)_
474474

475475
## `twilio autopilot:webhooks:delete`
476476

@@ -486,7 +486,7 @@ OPTIONS
486486
--webhook-sid=webhook-sid SID of the webhook to delete
487487
```
488488

489-
_See code: [src/commands/autopilot/webhooks/delete.js](https://github.com/dabblelab/twilio-cli-autopilot-plugin/blob/v1.0.2/src/commands/autopilot/webhooks/delete.js)_
489+
_See code: [src/commands/autopilot/webhooks/delete.js](https://github.com/dabblelab/twilio-cli-autopilot-plugin/blob/v1.0.3-beta.0/src/commands/autopilot/webhooks/delete.js)_
490490

491491
## `twilio autopilot:webhooks:list`
492492

@@ -506,7 +506,7 @@ OPTIONS
506506
507507
```
508508

509-
_See code: [src/commands/autopilot/webhooks/list.js](https://github.com/dabblelab/twilio-cli-autopilot-plugin/blob/v1.0.2/src/commands/autopilot/webhooks/list.js)_
509+
_See code: [src/commands/autopilot/webhooks/list.js](https://github.com/dabblelab/twilio-cli-autopilot-plugin/blob/v1.0.3-beta.0/src/commands/autopilot/webhooks/list.js)_
510510

511511
## `twilio autopilot:webhooks:update`
512512

@@ -526,7 +526,7 @@ OPTIONS
526526
--webhook-sid=webhook-sid SID of the webhook to update
527527
```
528528

529-
_See code: [src/commands/autopilot/webhooks/update.js](https://github.com/dabblelab/twilio-cli-autopilot-plugin/blob/v1.0.2/src/commands/autopilot/webhooks/update.js)_
529+
_See code: [src/commands/autopilot/webhooks/update.js](https://github.com/dabblelab/twilio-cli-autopilot-plugin/blob/v1.0.3-beta.0/src/commands/autopilot/webhooks/update.js)_
530530

531531
## `twilio autopilot:modelbuilds:create`
532532

@@ -542,7 +542,7 @@ OPTIONS
542542
-u, --callbackURL=callbackURL URL to get notified of model build status
543543
```
544544

545-
_See code: [src/commands/autopilot/modelbuilds/create.js](https://github.com/dabblelab/twilio-cli-autopilot-plugin/blob/v1.0.2/src/commands/autopilot/modelbuilds/create.js)_
545+
_See code: [src/commands/autopilot/modelbuilds/create.js](https://github.com/dabblelab/twilio-cli-autopilot-plugin/blob/v1.0.3-beta.0/src/commands/autopilot/modelbuilds/create.js)_
546546

547547
## `twilio autopilot:simulate`
548548

@@ -558,7 +558,7 @@ OPTIONS
558558
-t, --text=text (required) User text input
559559
```
560560

561-
_See code: [src/commands/autopilot/simulate.js](https://github.com/dabblelab/twilio-cli-autopilot-plugin/blob/v1.0.2/src/commands/autopilot/simulate.js)_
561+
_See code: [src/commands/autopilot/simulate.js](https://github.com/dabblelab/twilio-cli-autopilot-plugin/blob/v1.0.3-beta.0/src/commands/autopilot/simulate.js)_
562562

563563
## `twilio autopilot:queries:export`
564564

@@ -574,7 +574,7 @@ OPTIONS
574574
-s, --assistant-sid=assistant-sid (required) assistant sid
575575
```
576576

577-
_See code: [src/commands/autopilot/queries/export.js](https://github.com/dabblelab/twilio-cli-autopilot-plugin/blob/v1.0.2/src/commands/autopilot/queries/export.js)_
577+
_See code: [src/commands/autopilot/queries/export.js](https://github.com/dabblelab/twilio-cli-autopilot-plugin/blob/v1.0.3-beta.0/src/commands/autopilot/queries/export.js)_
578578

579579
## `twilio help [COMMAND]`
580580

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
{
22
"name": "@dabblelab/plugin-autopilot",
33
"description": "Create, Update, Delete, List, Simulate, Import and Export Twilio Autopilot Assistant",
4-
"version": "1.0.2",
4+
"version": "1.0.3-beta.0",
55
"author": "Steve Tingiris",
66
"bugs": "https://github.com/tingiris/twilio-cli-autopilot-plugin/issues",
77
"dependencies": {
88
"@dabblelab/autopilot-core": "^1.0.0-beta.12",
99
"@oclif/command": "^1.5.19",
1010
"@oclif/config": "^1.13.3",
1111
"@oclif/plugin-help": "^2.2.3",
12+
"@twilio-labs/serverless-api": "^3.0.0",
1213
"@twilio/cli-core": "^4.4.0",
1314
"csv-parse": "^4.8.2",
1415
"extract-zip": "^1.6.7",

src/lib/serverless/deploy.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ function handleError(err, spinner, flags, config) {
5858
function handler(flags, externalCliOptions) {
5959
return __awaiter(this, void 0, void 0, function* () {
6060
logger_1.setLogLevelByName(flags.logLevel);
61-
const cwd = path_1.default.resolve(process.cwd(), 'function');
61+
const cwd = path_1.default.resolve(flags.cwd || process.cwd(), 'function');
6262
flags.cwd = cwd;
6363
const command = utils_2.getFullCommand(flags);
6464
yield project_structure_1.default(cwd, command, true);
@@ -67,6 +67,7 @@ function handler(flags, externalCliOptions) {
6767
config = yield deploy_1.getConfigFromFlags(flags, externalCliOptions);
6868
}
6969
catch (err) {
70+
console.log(err);
7071
debug(err);
7172
logError(err.message);
7273
process.exit(1);
@@ -81,6 +82,7 @@ function handler(flags, externalCliOptions) {
8182
check_credentials_1.checkConfigForCredentials(config);
8283
const spinner = logger_1.getOraSpinner('Deploying Function').start();
8384
try {
85+
8486
const client = new serverless_api_1.TwilioServerlessApiClient(config);
8587
client.on('status-update', evt => {
8688
spinner.text = evt.message + '\n';
@@ -89,7 +91,7 @@ function handler(flags, externalCliOptions) {
8991
spinner.text = 'Serverless function successfully deployed';
9092
spinner.succeed();
9193
const { serviceSid, buildSid } = result;
92-
yield utils_1.saveLatestDeploymentData(config.cwd, serviceSid, buildSid, config.accountSid.startsWith('AC')
94+
yield utils_1.saveLatestDeploymentData(config.cwd, serviceSid, buildSid, config.accountSid && config.accountSid.startsWith('AC')
9395
? config.accountSid
9496
: externalCliOptions && externalCliOptions.accountSid);
9597

@@ -98,6 +100,8 @@ function handler(flags, externalCliOptions) {
98100
};
99101
}
100102
catch (err) {
103+
104+
console.log(err);
101105
handleError(err, spinner, flags, config);
102106
}
103107
});

0 commit comments

Comments
 (0)