Download private storage before pulling data from Splatnet
Some checks are pending
Build frontend / build (20.x) (push) Waiting to run
Deploy / deploy-frontend (push) Waiting to run
Deploy / deploy-backend (push) Waiting to run
Fix code styles / build (push) Waiting to run

This commit is contained in:
Matt Isenhower
2024-12-14 16:02:49 -08:00
parent 9eb3c4c1bc
commit 6dc7fd0bdb
2 changed files with 8 additions and 3 deletions

View File

@@ -43,6 +43,11 @@ export async function update(config = 'default') {
let settings = configs[config];
// Download private files to get updated tokens if needed
if (canSync()) {
await (new S3Syncer).download(false);
}
await Promise.all(updaters().map(async updater => {
updater.settings = settings;
try {

View File

@@ -5,14 +5,14 @@ import mime from 'mime-types';
export default class S3Syncer
{
download() {
download(dist = true, storage = true) {
this.log('Downloading files...');
return Promise.all([
this.syncClient.sync(this.publicBucket, `${this.localPath}/dist`, {
dist && this.syncClient.sync(this.publicBucket, `${this.localPath}/dist`, {
filters: this.filters,
}),
this.syncClient.sync(this.privateBucket, `${this.localPath}/storage`, {
storage && this.syncClient.sync(this.privateBucket, `${this.localPath}/storage`, {
filters: this.privateFilters,
}),
]);