From 5db477fa32070ae5c834f635ea4c55061156f126 Mon Sep 17 00:00:00 2001 From: Justin Plock Date: Wed, 27 Nov 2019 12:28:41 -0500 Subject: [PATCH] Expand pip commands into separate entries --- lib/pip.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/pip.js b/lib/pip.js index caf48f3e..05fa9392 100644 --- a/lib/pip.js +++ b/lib/pip.js @@ -123,9 +123,16 @@ function installRequirements(targetFolder, serverless, options) { options.pythonBin, '-m', 'pip', - 'install', - ...options.pipCmdExtraArgs + 'install' ]; + + if (Array.isArray(options.pipCmdExtraArgs) && options.pipCmdExtraArgs.length > 0) { + options.pipCmdExtraArgs.forEach(cmd => { + const parts = cmd.split(/\s+/, 2); + pipCmd.push(...parts); + }); + } + const pipCmds = [pipCmd]; const postCmds = []; // Check if we're using the legacy --cache-dir command...