Skip to content

Commit

Permalink
fix: fixes running ci from root
Browse files Browse the repository at this point in the history
  • Loading branch information
jmgilman committed Sep 16, 2024
1 parent f16fc70 commit d5c2176
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
14 changes: 7 additions & 7 deletions forge/cli/pkg/scan/project.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,19 @@ func ScanProjects(rootPath string, l project.ProjectLoader, w walker.Walker, log

path = filepath.Dir(path)

logger.Info("loading project", "path", path)
p, err := l.Load(path)
if err != nil {
logger.Error("error loading project", "path", path, "error", err)
return fmt.Errorf("error loading %s: %w", path, err)
}

// We need to drop the blueprint suffix and make sure relative paths
// include a leading "./" to avoid confusing the Earthly CLI
if !strings.HasPrefix(rootPath, "/") && path != "." {
path = fmt.Sprintf("./%s", path)
}

logger.Info("loading project", "path", path, "rootPath", rootPath)
p, err := l.Load(path)
if err != nil {
logger.Error("error loading project", "path", path, "error", err)
return fmt.Errorf("error loading %s: %w", path, err)
}

projects[path] = p

return nil
Expand Down
4 changes: 4 additions & 0 deletions forge/cli/tui/ci/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,10 @@ func Run(scanPath string,
if err != nil {
return fmt.Errorf("failed to get relative path: %w", err)
}

if scanPath == "" {
scanPath = "."
}
}

project, err := loader.Load(scanPath)
Expand Down

0 comments on commit d5c2176

Please sign in to comment.