(fileOrDirectory)
| 287 | } |
| 288 | |
| 289 | function getBasename(fileOrDirectory) { |
| 290 | // Note, can't use fs.lstatSync().isDirectory() because it's just a string |
| 291 | // at this point. It might not exist. |
| 292 | |
| 293 | if (fileOrDirectory.endsWith('index.md')) { |
| 294 | return path.basename(path.directory(fileOrDirectory)) |
| 295 | } |
| 296 | if (fileOrDirectory.endsWith('.md')) { |
| 297 | return path.basename(fileOrDirectory).replace(/\.md$/, '') |
| 298 | } |
| 299 | return path.basename(fileOrDirectory) |
| 300 | } |
| 301 | |
| 302 | function removeFromChildren(oldPath, opts) { |
| 303 | const { verbose } = opts |
no outgoing calls
no test coverage detected