* The note's directory relative to its top-level folder root ('' when * it sits at the folder root). Carried along on archive/trash moves so * the reverse move puts the note back in the subfolder it came from.
(root: string, abs: string)
| 3193 | * the reverse move puts the note back in the subfolder it came from. |
| 3194 | */ |
| 3195 | async function folderSubpathOf(root: string, abs: string): Promise<string> { |
| 3196 | const folder = folderOf(root, abs) |
| 3197 | if (!folder) return '' |
| 3198 | const sourceRoot = await folderRoot(root, folder) |
| 3199 | const relDir = path.relative(sourceRoot, path.dirname(abs)) |
| 3200 | if (!relDir || relDir.startsWith('..') || path.isAbsolute(relDir)) return '' |
| 3201 | return toPosix(relDir) |
| 3202 | } |
| 3203 | |
| 3204 | async function moveBetweenFolders( |
| 3205 | root: string, |
no test coverage detected