MCPcopy Index your code
hub / github.com/github/docs / findInLearningTracks

Function findInLearningTracks

script/move-content.js:527–547  ·  view source on GitHub ↗
(href)

Source from the content-addressed store, hash-verified

525}
526
527function findInLearningTracks(href) {
528 const allFiles = walk(path.join(DATA_ROOT, 'learning-tracks'), {
529 globs: ['*.yml'],
530 includeBasePath: true,
531 directories: false,
532 })
533 const found = []
534 for (const filePath of allFiles) {
535 const tracks = yaml.load(fs.readFileSync(filePath, 'utf-8'))
536
537 if (
538 Object.values(tracks).find((track) => {
539 const guides = track.guides || []
540 return guides.includes(href)
541 })
542 ) {
543 found.push(filePath)
544 }
545 }
546 return found
547}
548
549function changeLearningTracks(filePath, oldHref, newHref) {
550 // Can't deserialize and serialize the Yaml because it would lose

Callers 2

editFilesFunction · 0.85
undoFilesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected