Skip to content

Commit

Permalink
Merge pull request #773 from devsapp/fix/issue
Browse files Browse the repository at this point in the history
Fix/issue
  • Loading branch information
heimanba authored Jun 29, 2022
2 parents 50e8ee5 + ce99b4a commit d40fb04
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 10 deletions.
5 changes: 3 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,9 @@ export default class FcBaseComponent extends EntryPublicMethod {
core.help(HELP.BUILD_HELP_INFO);
return;
}
await this.componentMethodCaller(inputs, 'devsapp/fc-build', 'build', props, args);
tips.showNextTip(args, tips.showBuildNextTips);
const output = await this.componentMethodCaller(inputs, 'devsapp/fc-build', 'build', props, args);
tips.showBuildNextTips(output?.buildSaveUri);
return output?.buildSaveUri;
}

async local(inputs: IInputs): Promise<any> {
Expand Down
4 changes: 3 additions & 1 deletion src/lib/component/instance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,9 @@ export default class Instance {
functionName,
qualifier,
} = props;
return (await Client.fcClient.listInstances(serviceName, functionName, qualifier)).data;
return {
functionName: (await Client.fcClient.listInstances(serviceName, functionName, qualifier)).data
};
}

async exec(props) {
Expand Down
2 changes: 1 addition & 1 deletion src/lib/component/remove.ts
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ export default class Remove {
return (await core.loadComponent(componentName)).deleteLayer(componentInputs);
}

if (!subCommand || subCommand === 'domain') {
if (subCommand === 'domain') {
const componentName = 'devsapp/fc-deploy';
const componentInputs = this.genInputs(inputs, componentName, inputs.props, planArgs);
return (await core.loadComponent(componentName)).remove(componentInputs);
Expand Down
15 changes: 9 additions & 6 deletions src/lib/tips.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
import { Logger, commandParse } from '@serverless-devs/core';

export function showBuildNextTips() {
export function showBuildNextTips(buildSaveUri?: string) {
const eventInvokeTip = 's local invoke';
const httpInvokeTip = 's local start';
const deployTip = 's deploy';

Logger.log(
`\nTips for next step
let logStr = `\nTips for next step
======================
* Invoke Event Function: ${eventInvokeTip}
* Invoke Http Function: ${httpInvokeTip}
* Deploy Resources: ${deployTip}`,
'yellow',
);
* Deploy Resources: ${deployTip}`;

if (buildSaveUri) {
logStr = `${logStr}\n* Code Output Path: ${buildSaveUri}\n`
}

Logger.log(logStr, 'yellow');
}

export function showLocalNextTips() {
Expand Down

0 comments on commit d40fb04

Please sign in to comment.