backups: encode extension into the remotePath
This commit is contained in:
@@ -20,13 +20,10 @@ function getBackupFilePath(backupTarget, remotePath) {
|
||||
assert.strictEqual(typeof backupTarget, 'object');
|
||||
assert.strictEqual(typeof remotePath, 'string');
|
||||
|
||||
const rootPath = backupTarget.config.rootPath;
|
||||
const fileType = backupTarget.encryption ? '.tar.gz.enc' : '.tar.gz';
|
||||
|
||||
// we don't have a rootPath for noop
|
||||
if (backupTarget.provider === 'noop') return remotePath + fileType;
|
||||
if (backupTarget.provider === 'noop') return remotePath;
|
||||
|
||||
return path.join(rootPath, remotePath + fileType);
|
||||
return path.join(backupTarget.config.rootPath, remotePath);
|
||||
}
|
||||
|
||||
// In tar, the entry header contains the file size. If we don't provide it those many bytes, the tar will become corrupt
|
||||
|
||||
Reference in New Issue
Block a user