Skip to content

Commit 95618de

Browse files
snicmakinokaochiuan
authored andcommitted
fix: Address unknown path format error in wsl2 (serverless#667)
1 parent b312180 commit 95618de

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/docker.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ const { spawnSync } = require('child_process');
22
const isWsl = require('is-wsl');
33
const fse = require('fs-extra');
44
const path = require('path');
5+
const os = require('os');
56

67
/**
78
* Helper function to run a docker command
@@ -102,7 +103,8 @@ function tryBindPath(serverless, bindPath, testFile) {
102103
*/
103104
function getBindPath(serverless, servicePath) {
104105
// Determine bind path
105-
if (process.platform !== 'win32' && !isWsl) {
106+
let isWsl1 = isWsl && !os.release().includes('microsoft-standard');
107+
if (process.platform !== 'win32' && !isWsl1) {
106108
return servicePath;
107109
}
108110

0 commit comments

Comments
 (0)