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

Function makeHref

script/move-content.js:234–242  ·  view source on GitHub ↗
(root, filePath)

Source from the content-addressed store, hash-verified

232}
233
234function makeHref(root, filePath) {
235 const nameSplit = path.relative(root, filePath).split(path.sep)
236 if (nameSplit.slice(-1)[0] === 'index.md') {
237 nameSplit.pop()
238 } else {
239 nameSplit.push(nameSplit.pop().replace(/\.md$/, ''))
240 }
241 return '/' + nameSplit.join('/')
242}
243
244function moveFolder(oldPath, newPath, files, opts) {
245 const { verbose, git: useGit } = opts

Callers 2

mainFunction · 0.85
findFilesInFolderFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected