Skip to content

Commit

Permalink
stacks remote
Browse files Browse the repository at this point in the history
  • Loading branch information
Listener430 committed Dec 26, 2024
1 parent 110a71d commit ea78b85
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions internal/exec/stack_processor_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit ea78b85

Please sign in to comment.