Skip to content

Commit

Permalink
upd Update out of date links
Browse files Browse the repository at this point in the history
  • Loading branch information
pchiorean committed Oct 27, 2021
1 parent d0eac1f commit f512575
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions setup/ReplaceLinks.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Replace links 1.1.1 (2021-10-11)
Replace links 1.2 (2021-10-27)
(c) 2020-2021 Paul Chiorean (jpeg@basement.ro)
Replaces document links from a 2-column TSV file named 'links.txt':
Expand Down Expand Up @@ -56,7 +56,8 @@ function main() {
links = doc.links.everyItem().getElements();
while ((link = links.shift())) {
if (!isIn(link.name, data.records[r].oldLinks)) continue; // Skip not matched
if (File(link.filePath).fullName === File(data.records[r].newLink).fullName) continue; // Skip self
if (File(link.filePath).fullName === File(data.records[r].newLink).fullName &&
link.status !== LinkStatus.LINK_OUT_OF_DATE) continue; // Skip self
link.relink(File(data.records[r].newLink));
counter++;
data.errors.info.push('Relinked \'' + decodeURI(link.name) + '\' with \'' +
Expand Down

0 comments on commit f512575

Please sign in to comment.