Skip to content

Commit

Permalink
Merge pull request #73 from devsapp/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
mamba authored Sep 6, 2022
2 parents 0aefadb + c1120b0 commit 759d6e0
Show file tree
Hide file tree
Showing 11 changed files with 135 additions and 127 deletions.
196 changes: 98 additions & 98 deletions dist/index.js

Large diffs are not rendered by default.

36 changes: 18 additions & 18 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,11 @@ export default class SaeComponent {
logger.error(`${error.result.Message}`);
return;
}
if(lodash.isEmpty(orderId)){
vm.stop();
logger.success('replicas无变动');
return;
}
// 检查状态
vm.text = `应用扩缩容${appName}...` + getLink(orderId);
await utils.getStatusByOrderId(orderId);
Expand Down
2 changes: 1 addition & 1 deletion src/lib/help/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export const DEPLOY = [
},
{
header: 'Document',
content: 'https://github.com/devsapp/sae/blob/main/docs/command/deploy.md',
content: 'https://github.com/devsapp/sae/blob/master/docs/deploy.md',
},
{
header: 'Usage',
Expand Down
2 changes: 1 addition & 1 deletion src/lib/help/info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export const INFO = [
},
{
header: 'Document',
content: 'https://github.com/devsapp/sae/blob/main/docs/command/info.md',
content: 'https://github.com/devsapp/sae/blob/master/docs/info.md',
},
{
header: 'Usage',
Expand Down
2 changes: 1 addition & 1 deletion src/lib/help/remove.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export const REMOVE = [
},
{
header: 'Document',
content: 'https://github.com/devsapp/sae/blob/main/docs/command/remove.md',
content: 'https://github.com/devsapp/sae/blob/master/docs/remove.md',
},
{
header: 'Usage',
Expand Down
2 changes: 1 addition & 1 deletion src/lib/help/rescale.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export const RESCALE = [
},
{
header: 'Document',
content: 'https://github.com/devsapp/sae/blob/main/docs/command/rescale.md',
content: 'https://github.com/devsapp/sae/blob/master/docs/rescale.md',
},
{
header: 'Usage',
Expand Down
2 changes: 1 addition & 1 deletion src/lib/help/start.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export const START = [
},
{
header: 'Document',
content: 'https://github.com/devsapp/sae/blob/main/docs/command/start.md',
content: 'https://github.com/devsapp/sae/blob/master/docs/start.md',
},
{
header: 'Usage',
Expand Down
2 changes: 1 addition & 1 deletion src/lib/help/stop.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export const STOP = [
},
{
header: 'Document',
content: 'https://github.com/devsapp/sae/blob/main/docs/command/stop.md',
content: 'https://github.com/devsapp/sae/blob/master/docs/stop.md',
},
{
header: 'Usage',
Expand Down
2 changes: 1 addition & 1 deletion src/lib/help/sync.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export const SYNC = [
},
{
header: 'Document',
content: 'https://github.com/devsapp/sae/blob/main/docs/command/sync.md',
content: 'https://github.com/devsapp/sae/blob/master/docs/sync.md',
},
{
header: 'Usage',
Expand Down
11 changes: 7 additions & 4 deletions src/lib/input-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,6 @@ export async function handlerReScaleInputs(args: string, application: any) {
namespaceId = data['namespace-id'];
region = data['region'];
}
if (lodash.isEmpty(replicas)) {
throw new core.CatchableError('未指定replicas参数')
}

if (lodash.isEmpty(appName)) {
appName = application?.appName;
Expand All @@ -122,14 +119,20 @@ export async function handlerReScaleInputs(args: string, application: any) {
if (lodash.isEmpty(region)) {
region = application?.region;
}
if (!replicas) {
replicas = application?.replicas;
}
if (!isHelp) {
if (!replicas) {
throw new core.CatchableError('未指定replicas参数')
}
if (lodash.isEmpty(appName)) {
throw new core.CatchableError('参数 application-name 不能为空');
}
if (lodash.isEmpty(region)) {
throw new core.CatchableError('参数 region 不能为空');
}
if (!isHelp && !(Number.isInteger(replicas) && replicas > 0)) {
if ( !(Number.isInteger(replicas) && replicas > 0)) {
throw new core.CatchableError('需要指定正确的replicas参数')
}
}
Expand Down

0 comments on commit 759d6e0

Please sign in to comment.