Use move instead of copy in GCS migrate when requested.

Signed-off-by: Eric Peterson <ericpeterson@spotify.com>
This commit is contained in:
Eric Peterson
2021-07-12 11:12:39 +02:00
parent c23b09d52d
commit e8302ea5a4
@@ -54,9 +54,8 @@ export class MigrateWriteStream extends Writable {
}
// Otherwise, copy or move the file.
// todo: Use file.move instead of file.copy when removeOriginal is true.
const migrate = this.removeOriginal
? file.copy.bind(file)
? file.move.bind(file)
: file.copy.bind(file);
this.logger.debug(`Migrating ${file.name}`);
migrate(newFile)