mirror of
https://github.com/ThatGuySam/doesitarm.git
synced 2026-05-15 06:35:20 -07:00
Merge related links
This commit is contained in:
parent
33c7623bfd
commit
86ed9f50c8
1 changed files with 15 additions and 1 deletions
|
|
@ -284,6 +284,7 @@ export default async function () {
|
|||
let bundleId = null
|
||||
let tags = []
|
||||
let aliases = []
|
||||
const relatedLinksMap = new Map( getTokenLinks(token.children).map( link => [ link.href, link ] ) )
|
||||
|
||||
// Search for this app in the scanList and remove duplicates
|
||||
scanListMap.forEach( ( scannedApp, key ) => {
|
||||
|
|
@ -308,13 +309,26 @@ export default async function () {
|
|||
...scannedApp.aliases
|
||||
]))
|
||||
|
||||
// Merge relatated links
|
||||
for ( const link of scannedApp.relatedLinks ) {
|
||||
|
||||
relatedLinksMap.set( link.href, {
|
||||
...link,
|
||||
label: (link.label === 'View') ? 'App Website' : link.label
|
||||
} )
|
||||
}
|
||||
|
||||
console.log(`Merged ${alias} (${scannedApp.bundleId}) from scanned apps into ${name} from README`)
|
||||
scanListMap.delete( key )
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
const relatedLinks = getTokenLinks(token.children)
|
||||
|
||||
// Convert link map values into array for JSON
|
||||
const relatedLinks = Array.from( relatedLinksMap.values() )
|
||||
|
||||
// console.log('relatedLinks', relatedLinks)
|
||||
|
||||
const appSlug = makeSlug( name )
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue