fix(fs/path/relativeFromFile): correctly handle relative paths

This commit is contained in:
Julien Fontanet 2024-02-15 09:13:10 +01:00
parent 757a8915d9
commit 509ebf900e
2 changed files with 4 additions and 1 deletions

View File

@ -20,5 +20,7 @@ export function split(path) {
return parts
}
export const relativeFromFile = (file, path) => relative(dirname(file), path)
// paths are made absolute otherwise fs.relative() would resolve them against working directory
export const relativeFromFile = (file, path) => relative(dirname(normalize(file)), normalize(path))
export const resolveFromFile = (file, path) => resolve('/', dirname(file), path).slice(1)

View File

@ -35,6 +35,7 @@
<!--packages-start-->
- @xen-orchestra/backups patch
- @xen-orchestra/fs patch
- @xen-orchestra/xapi patch
- xo-server minor
- xo-server-audit patch