Skip to content

Commit

Permalink
refactor(CLI): Simplify deploy function args patch
Browse files Browse the repository at this point in the history
  • Loading branch information
medikoo committed Jan 27, 2022
1 parent 3328aa8 commit 6527f8a
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions scripts/serverless.js
Expand Up @@ -102,7 +102,8 @@ const processSpanPromise = (async () => {
const processBackendNotificationRequest = require('../lib/utils/processBackendNotificationRequest');
const logDeprecation = require('../lib/utils/logDeprecation');

const rewriteDeployFunctionParam = () => {
(() => {
// Rewrite eventual `sls deploy -f` into `sls deploy function -f`
const isParamName = RegExp.prototype.test.bind(require('../lib/cli/param-reg-exp'));

const args = process.argv.slice(2);
Expand All @@ -115,9 +116,7 @@ const processSpanPromise = (async () => {
'Starting with v4.0.0, `--function` or `-f` option for `deploy` command will no longer be supported. In order to deploy a single function, please use `deploy function` command instead.'
);
process.argv.splice(3, 0, 'function');
};

rewriteDeployFunctionParam();
})();

const resolveInput = require('../lib/cli/resolve-input');

Expand Down

0 comments on commit 6527f8a

Please sign in to comment.