Files
Xen-Orchestra-xen-orchestra…/packages/vhd-lib/_resolveRelativeFromFile.js
Florent Beauchamp 4b3f60b280 feat(backups): implement differential restore
When restoring a backup, try to reuse data from an existing snapshot.
We use this snasphot and apply a reverse differential of the changes
between the backup and the snapshot

Prerequisite : a uninterrupted delta chain from the backup being
restored to a backup that still have its snapshot on the host
2023-11-30 10:12:20 +01:00

12 lines
279 B
JavaScript

'use strict'
const { dirname, resolve } = require('path')
const resolveRelativeFromFile = (file, path) => {
if (file.startsWith('/')) {
return resolve(dirname(file), path)
}
return resolve('/', dirname(file), path).slice(1)
}
module.exports = resolveRelativeFromFile