Skip to content
This repository has been archived by the owner on Sep 10, 2024. It is now read-only.

Commit

Permalink
improved debug.
Browse files Browse the repository at this point in the history
  • Loading branch information
bengarrett committed Jul 30, 2023
1 parent c6236ca commit e489a07
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pkg/images/images.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ func Fix(db *sql.DB, w io.Writer) error {
c++
fmt.Fprintf(w, "%s%d. %v", str.PrePad, c, img)
if _, err := os.Stat(filepath.Join(dir.UUID, img.UUID)); errors.Is(err, fs.ErrNotExist) {
fmt.Fprintf(w, "%s\n", str.X())
fmt.Fprintf(w, "%s %q\n", str.X(), filepath.Join(dir.UUID, img.UUID))
continue
} else if err != nil {
return fmt.Errorf("images fix stat: %w", err)
Expand Down
4 changes: 3 additions & 1 deletion pkg/text/text.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,13 @@ func fixRow(
if err1 := rows.Scan(&t.ID, &t.UUID, &t.Name, &t.Size, &t.NoReadme, &t.Readme, &t.Platform); err1 != nil {
return t, i, c, fmt.Errorf("fix rows scan: %w", err1)
}
fmt.Fprintf(w, "\n%s%d. %s", str.PrePad, i, t.String())
ok, err := t.Exist(dir)
if err != nil {
return t, i, c, fmt.Errorf("fix exist: %w", err)
}
if !ok {
fmt.Fprintf(w, "\n%s%d. %s", str.PrePad, i, t.String())
}
// missing images + source is an archive
if !ok && t.Archive() {
c++
Expand Down

0 comments on commit e489a07

Please sign in to comment.