diff --git a/package.json b/package.json index 1f457a328853a23ccacabaf9fc3f5fcc0d67a9fe..d3c7f878158aec75ec5e15bda862ab97175091a3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@serverless-devs/s", - "version": "2.0.100-beta.10", + "version": "2.0.100-beta.11", "description": "Serverless devs tool, serverless developer tool, supports Alibaba cloud, AWS, azure, baidu cloud, Huawei cloud, Google cloud and Tencent cloud.", "homepage": "https://www.serverless-devs.com", "keywords": [ diff --git a/src/index.ts b/src/index.ts index 8d7b7b97448653a789f94f2da0be8ebddb41185c..3eaf9ffe9fa7cd8be1c46c0440b3d58f8d78cb89 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,12 +1,13 @@ import program from '@serverless-devs/commander'; import { registerCommandChecker, logger } from './utils'; -import { join } from 'lodash'; +import { join, includes } from 'lodash'; import { emoji, getVersion } from './utils/common'; import UpdateNotifier from './update-notifier'; import onboarding from './onboarding'; import { HandleError } from './error'; import SpecialCommad from './special-commad'; import help from './help'; +import { COMMAND_LIST } from './constant'; const pkg = require('../package.json'); (async () => { @@ -41,7 +42,14 @@ const pkg = require('../package.json'); return await onboarding(); } await help(system_command); - await new SpecialCommad(system_command).init(); + + if (includes(COMMAND_LIST, process.argv[2])) { + system_command.parse(process.argv); + } else { + // 鑷畾涔夋寚浠�: s deploy + await new SpecialCommad(system_command).init(); + system_command.parse(process.argv.filter(o => o !== '-h')); + } system_command.exitOverride(async error => { if (error.code === 'commander.help') { @@ -51,7 +59,6 @@ const pkg = require('../package.json'); process.exit(0); } }); - system_command.parse(process.argv.filter(o => o !== '-h')); })().catch(async error => { await HandleError(error); }); diff --git a/src/special-commad/index.ts b/src/special-commad/index.ts index 84e7d5bb3cd907db035a8a56196c8d60467a49b7..c4a8369bc27c4e1bfd35b88086e0be2ade5688f3 100644 --- a/src/special-commad/index.ts +++ b/src/special-commad/index.ts @@ -1,14 +1,12 @@ import { CommanderStatic, Command } from '@serverless-devs/commander'; import core from '../utils/core'; import { isEmpty, includes, keys, get } from 'lodash'; -import { COMMAND_LIST } from '../constant'; const { getGlobalArgs, execCommand, getTemplatePath, getYamlContent } = core; class SpecialCommad { constructor(private command: CommanderStatic) {} async init() { - if (includes(COMMAND_LIST, process.argv[2])) return; const argv = getGlobalArgs(process.argv.slice(2)); const { _: rawData, template, access, 'skip-actions': skipActions, debug } = argv; if (isEmpty(rawData)) return;