mirror of
https://github.com/misenhower/splatoon2.ink.git
synced 2026-04-24 23:37:00 -05:00
25 lines
474 B
JavaScript
25 lines
474 B
JavaScript
const S3Syncer = require('./S3Syncer');
|
|
|
|
function canSync() {
|
|
return !!(
|
|
process.env.AWS_ACCESS_KEY_ID &&
|
|
process.env.AWS_SECRET_ACCESS_KEY &&
|
|
process.env.AWS_S3_BUCKET &&
|
|
process.env.AWS_S3_PRIVATE_BUCKET
|
|
);
|
|
}
|
|
|
|
function sync() {
|
|
if (!canSync()) {
|
|
console.warn('Missing S3 connection parameters');
|
|
return;
|
|
}
|
|
|
|
console.info('Syncing files...');
|
|
|
|
const syncer = new S3Syncer();
|
|
return syncer.sync();
|
|
}
|
|
|
|
module.exports = { canSync, sync };
|