mirror of
https://github.com/GenderDysphoria/GenderDysphoria.fyi.git
synced 2025-01-30 23:06:18 +00:00
Fail gracefully when aws.json is missing.
This commit is contained in:
parent
6dafd926de
commit
b16514219b
@ -3,7 +3,12 @@ const awspublish = require('gulp-awspublish');
|
|||||||
const awsrouter = require('gulp-awspublish-router');
|
const awsrouter = require('gulp-awspublish-router');
|
||||||
const parallelize = require('concurrent-transform');
|
const parallelize = require('concurrent-transform');
|
||||||
|
|
||||||
var credentials = require('../aws.json');
|
var credentials;
|
||||||
|
try {
|
||||||
|
credentials = require('../aws.json');
|
||||||
|
} catch (e) {
|
||||||
|
credentials = null;
|
||||||
|
}
|
||||||
|
|
||||||
const routes = {
|
const routes = {
|
||||||
'p\\/.*\\.(?:jpeg|jpg|png|gif)$': {
|
'p\\/.*\\.(?:jpeg|jpg|png|gif)$': {
|
||||||
@ -36,6 +41,10 @@ const routes = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
module.exports = exports = function s3deploy () {
|
module.exports = exports = function s3deploy () {
|
||||||
|
if (!credentials) {
|
||||||
|
console.error('Cannot publish without AWS credentials present.'); // eslint-disable-line
|
||||||
|
return false;
|
||||||
|
}
|
||||||
var publisher = awspublish.create(credentials);
|
var publisher = awspublish.create(credentials);
|
||||||
|
|
||||||
return src('dist/**/*')
|
return src('dist/**/*')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user