Skip to content

Fix issue 274 #281

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ class ServerlessPythonRequirements {
if (options.dockerizePip === 'non-linux') {
options.dockerizePip = process.platform !== 'linux';
}
if (options.dockerizePip && process.platform === 'win32') {
options.pythonBin = 'python';
}
if (
!options.dockerizePip &&
(options.dockerSsh || options.dockerImage || options.dockerFile)
Expand Down
7 changes: 5 additions & 2 deletions lib/docker.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ const path = require('path');
*/
function dockerCommand(options) {
const cmd = 'docker';
const ps = spawnSync(cmd, options, { encoding: 'utf-8' });
const ps = spawnSync(cmd, options, {
encoding: 'utf-8',
windowsVerbatimArguments: true
});
if (ps.error) {
if (ps.error.code === 'ENOENT') {
throw new Error('docker not found! Please install it.');
Expand Down Expand Up @@ -134,7 +137,7 @@ function getBindPath(serverless, servicePath) {

for (let i = 0; i < bindPaths.length; i++) {
const bindPath = bindPaths[i];
if (tryBindPath(serverless, bindPath, testFile)) {
if (tryBindPath(serverless, `"${bindPath}"`, testFile)) {
return bindPath;
}
}
Expand Down