mirror of
https://github.com/Mibew/first-message-plugin.git
synced 2024-11-15 00:34:17 +03:00
46 lines
1.2 KiB
JavaScript
46 lines
1.2 KiB
JavaScript
var eventStream = require('event-stream'),
|
|
gulp = require('gulp'),
|
|
chmod = require('gulp-chmod'),
|
|
zip = require('gulp-zip'),
|
|
tar = require('gulp-tar'),
|
|
gzip = require('gulp-gzip'),
|
|
rename = require('gulp-rename');
|
|
|
|
gulp.task('prepare-release', function() {
|
|
var version = require('./package.json').version;
|
|
|
|
return eventStream.merge(
|
|
getSources()
|
|
.pipe(zip('first-message-plugin-' + version + '.zip')),
|
|
getSources()
|
|
.pipe(tar('first-message-plugin-' + version + '.tar'))
|
|
.pipe(gzip())
|
|
)
|
|
.pipe(chmod(0644))
|
|
.pipe(gulp.dest('release'));
|
|
});
|
|
|
|
// Builds and packs plugins sources
|
|
gulp.task('default', gulp.series('prepare-release'));
|
|
|
|
/**
|
|
* Returns files stream with the plugin sources.
|
|
*
|
|
* @returns {Object} Stream with VinylFS files.
|
|
*/
|
|
var getSources = function() {
|
|
return gulp.src([
|
|
'Controller/*',
|
|
'Message.php',
|
|
'Plugin.php',
|
|
'README.md',
|
|
'LICENSE',
|
|
'routing.yml'
|
|
],
|
|
{base: './'}
|
|
)
|
|
.pipe(rename(function(path) {
|
|
path.dirname = 'Mibew/Mibew/Plugin/FirstMessage/' + path.dirname;
|
|
}));
|
|
};
|