From 9d9a407c3dde9a1f8d3e702787cad6e2fdfb2c9c Mon Sep 17 00:00:00 2001 From: Johannes Zellner Date: Mon, 16 Oct 2023 16:36:31 +0200 Subject: [PATCH] Noop provider does not have a rootPath set --- src/backupformat/rsync.js | 3 +++ src/backupformat/tgz.js | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/backupformat/rsync.js b/src/backupformat/rsync.js index 0dafa55d3..bf400813b 100644 --- a/src/backupformat/rsync.js +++ b/src/backupformat/rsync.js @@ -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); } diff --git a/src/backupformat/tgz.js b/src/backupformat/tgz.js index 9dff4fc01..78701de4e 100644 --- a/src/backupformat/tgz.js +++ b/src/backupformat/tgz.js @@ -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);