From ea78b85ecee31ab7f5de7b590e40b7585029ec3b Mon Sep 17 00:00:00 2001 From: Andrey Kalmykov Date: Fri, 27 Dec 2024 01:20:16 +0600 Subject: [PATCH] stacks remote --- internal/exec/stack_processor_utils.go | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/internal/exec/stack_processor_utils.go b/internal/exec/stack_processor_utils.go index 108fcc66b..a5ceb6de6 100644 --- a/internal/exec/stack_processor_utils.go +++ b/internal/exec/stack_processor_utils.go @@ -1934,15 +1934,16 @@ func GetFileContent(filePath string) (string, error) { parsedURL, err := url.Parse(filePath) // Parse the URL if err != nil { u.LogInfo(schema.AtmosConfiguration{}, fmt.Sprintf("Filepath is local: %s", filePath)) - } - if parsedURL.Host == "github.com" && parsedURL.Scheme == "https" { - u.LogDebug(schema.AtmosConfiguration{}, fmt.Sprintf("Fetching GitHub source: %s", filePath)) - fileContents, err := u.DownloadFileFromGitHub(filePath) - if err != nil { - return "", fmt.Errorf("failed to download GitHub file: %w", err) + } else { + if parsedURL.Host == "github.com" && parsedURL.Scheme == "https" { + u.LogDebug(schema.AtmosConfiguration{}, fmt.Sprintf("Fetching GitHub source: %s", filePath)) + fileContents, err := u.DownloadFileFromGitHub(filePath) + if err != nil { + return "", fmt.Errorf("failed to download GitHub file: %w", err) + } + getFileContentSyncMap.Store(filePath, fileContents) + return string(fileContents), nil } - getFileContentSyncMap.Store(filePath, fileContents) - return string(fileContents), nil } content, err := os.ReadFile(filePath)