From 16390671cb27f885319917d93e9ece2d9f72ebc8 Mon Sep 17 00:00:00 2001 From: Qiao Han Date: Fri, 19 Apr 2024 04:55:54 +0800 Subject: [PATCH] fix(functions): duplicate mount point when passing fallback as flag --- internal/functions/serve/serve.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/internal/functions/serve/serve.go b/internal/functions/serve/serve.go index 1a52a9298..b1015732c 100644 --- a/internal/functions/serve/serve.go +++ b/internal/functions/serve/serve.go @@ -120,11 +120,13 @@ func ServeFunctions(ctx context.Context, envFilePath string, noVerifyJWT *bool, return err } } - modules, err := utils.BindImportMap(fallbackImportMapPath, dockerFallbackImportMapPath, fsys) - if err != nil { - return err + if fallbackImportMapPath != importMapPath { + modules, err := utils.BindImportMap(fallbackImportMapPath, dockerFallbackImportMapPath, fsys) + if err != nil { + return err + } + binds = append(binds, modules...) } - binds = append(binds, modules...) if err := utils.MkdirIfNotExistFS(fsys, utils.FunctionsDir); err != nil { return err