Skip to content

Commit

Permalink
Merge pull request #13 from sigmonsays/fix-loops
Browse files Browse the repository at this point in the history
ignore links to self
  • Loading branch information
sigmonsays authored Nov 30, 2022
2 parents 8174772 + c874241 commit ff5a968
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions link.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,13 @@ func CreateLinks(opts *LinkOptions, run *Run) error {
)

for _, li := range run.Links {

// validate we are not linking to ourselves
if li.AbsLink == li.Target {
log.Debugf("Ignoring symlink to self %s", li.AbsLink)
continue
}

if opts.Pretend {
if li.NeedsCreate {
log.Infof("create link %q %q", li.AbsLink, li.Target)
Expand Down

0 comments on commit ff5a968

Please sign in to comment.