UNPKG

@gravityforms/gulp-tasks

Version:
32 lines (26 loc) 811 B
const gulp = require( 'gulp' ); const awspublish = require( 'gulp-awspublish' ); module.exports = { sync( path, params ) { const config = params?.config; const headers = params?.headers || {}; const options = params?.options || {}; if ( ! path || ! config ) { console.log( 'You must supply an aws config and output path to run publish.' ); return; } if ( ! config.credentials.accessKeyId || ! config.credentials.secretAccessKey ) { console.log( 'You must supply an aws access key id and secret access key to run publish.' ); return; } const publisher = awspublish.create( config ); return ( gulp .src( path ) .pipe( publisher.publish( headers, options ) ) .pipe( publisher.sync() ) .pipe( publisher.cache() ) .pipe( awspublish.reporter() ) ); }, };