Skip to content

Commit 2f8fb8c

Browse files
committed
fix: use rename instead of link when adding
1 parent 3041eb2 commit 2f8fb8c

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

internal/publish/publish.go

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package publish
22

33
import (
4-
"errors"
54
"fmt"
65
"log/slog"
76
"os"
@@ -92,9 +91,7 @@ func (c *CLI) add() error {
9291
if err := os.MkdirAll(filepath.Dir(newPath), 0o700); err != nil {
9392
return err
9493
}
95-
if err := os.Link(path, newPath); errors.Is(err, os.ErrExist) {
96-
// never mind
97-
} else if err != nil {
94+
if err := os.Rename(path, newPath); err != nil {
9895
return err
9996
}
10097
return nil

0 commit comments

Comments
 (0)