Noop provider does not have a rootPath set

This commit is contained in:
Johannes Zellner
2023-10-16 16:36:31 +02:00
parent 7d731d7600
commit 9d9a407c3d
2 changed files with 6 additions and 0 deletions

View File

@@ -31,6 +31,9 @@ function getBackupFilePath(backupConfig, remotePath) {
assert.strictEqual(typeof backupConfig, 'object');
assert.strictEqual(typeof remotePath, 'string');
// we don't have a rootPath for noop
if (backupConfig.provider === 'noop') return remotePath;
return path.join(backupConfig.rootPath, remotePath);
}

View File

@@ -24,6 +24,9 @@ function getBackupFilePath(backupConfig, remotePath) {
assert.strictEqual(typeof backupConfig, 'object');
assert.strictEqual(typeof remotePath, 'string');
// we don't have a rootPath for noop
if (backupConfig.provider === 'noop') return remotePath + fileType;
const rootPath = backupConfig.rootPath;
const fileType = backupConfig.encryption ? '.tar.gz.enc' : '.tar.gz';
return path.join(rootPath, remotePath + fileType);