From 5d0d737d4927e0288c86fb93cfba520c44206d7b Mon Sep 17 00:00:00 2001 From: wss-git Date: Mon, 15 Nov 2021 11:17:10 +0800 Subject: [PATCH] fix: show url tip --- src/index.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/index.ts b/src/index.ts index 57df2ead..cbeb2486 100644 --- a/src/index.ts +++ b/src/index.ts @@ -470,9 +470,6 @@ export default class FcBaseComponent extends BaseComponent { }; this.logger.debug(`Using event options: \n${yaml.dump(eventTypeOpts)}`); } else if (stressOpts?.functionType === 'http') { - if (!argsData?.url) { - this.logger.error('Function type is http, please specify --url'); - } httpTypeOpts = { url: argsData?.url, method: argsData?.method, @@ -486,6 +483,9 @@ export default class FcBaseComponent extends BaseComponent { const fcStress: FcStress = new FcStress(project?.access, props?.region || argsData?.region, stressOpts, httpTypeOpts, eventTypeOpts, payloadOpts); let fcStressArgs: string; if (commandName === 'start') { + if (stressOpts?.functionType === 'http' && !argsData?.url) { + this.logger.error('Function type is http, please specify --url'); + } fcStressArgs = fcStress.makeStartArgs(); } else if (commandName === 'clean') { fcStressArgs = fcStress.makeCleanArgs(argsData['assume-yes']);