From 01643273df742239cd020e7d08941c505e540217 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1bor=20Lipt=C3=A1k?= Date: Tue, 22 Sep 2020 02:50:42 -0400 Subject: [PATCH] fix(AWS Local Invocation): Fix Dockerfile layer path on Windows (#8273) --- lib/plugins/aws/invokeLocal/index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/plugins/aws/invokeLocal/index.js b/lib/plugins/aws/invokeLocal/index.js index d0e2d473893..113990d1312 100644 --- a/lib/plugins/aws/invokeLocal/index.js +++ b/lib/plugins/aws/invokeLocal/index.js @@ -370,7 +370,9 @@ class AwsInvokeLocal { let dockerFileContent = `FROM lambci/lambda:${runtime}`; for (const layerPath of layerPaths) { - dockerFileContent += `\nADD --chown=sbx_user1051:495 ${layerPath} /opt`; + dockerFileContent += `\nADD --chown=sbx_user1051:495 ${ + os.platform() === 'win32' ? layerPath.replace(/\\/g, '/') : layerPath + } /opt`; } const dockerfilePath = path.join('.serverless', 'invokeLocal', runtime, 'Dockerfile');