Skip to content

Commit

Permalink
add logs
Browse files Browse the repository at this point in the history
Signed-off-by: Vasek - Tom C <[email protected]>
  • Loading branch information
TomChv committed Feb 15, 2024
1 parent e2c8abe commit 641f8be
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions daggerverse-cockpit/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,15 @@ func (d *DaggerverseCockpit) Publish(
paths[i] = filepath.Dir(path)
}

if !dryRun {
if dryRun {
return paths, nil
}

// Publish the modules to the daggerverse
eg, ctx := errgroup.WithContext(ctx)

for i, path := range paths {
i := i
path := path

eg.Go(func() error {
Expand All @@ -58,7 +59,12 @@ func (d *DaggerverseCockpit) Publish(
return err
}

paths[i] += fmt.Sprintf(" -> %s", strings.Split(result, "\n")[1])
// Retrieve the url of the module
logs := strings.Split(result, "\n")
url := strings.TrimSpace(logs[len(logs)-2])

// Add it to the output path
paths[i] += fmt.Sprintf(" published to: %s", url)

return nil
})
Expand Down

0 comments on commit 641f8be

Please sign in to comment.