no need for format specific getBackupFilePath

This commit is contained in:
Girish Ramakrishnan
2025-08-01 20:49:11 +02:00
parent ff6cbf6628
commit 7192439b2c
6 changed files with 25 additions and 38 deletions

View File

@@ -30,7 +30,9 @@ exports = module.exports = {
getMountStatus,
ensureMounted,
storageApi
storageApi,
getBackupFilePath
};
const assert = require('assert'),
@@ -97,6 +99,16 @@ function storageApi(backupTarget) {
}
}
function getBackupFilePath(backupTarget, remotePath) {
assert.strictEqual(typeof backupTarget, 'object');
assert.strictEqual(typeof remotePath, 'string');
// we don't have a rootPath for noop
if (backupTarget.provider === 'noop') return remotePath;
return path.join(backupTarget.config.rootPath, remotePath);
}
function getRootPath(provider, config, mountPath) {
assert.strictEqual(typeof config, 'object');
assert.strictEqual(typeof mountPath, 'string');