Finished up package.js and gulpfile.js fixes

This commit is contained in:
Derek McDaniel 2017-01-24 23:31:10 -05:00
parent 5814fd3405
commit 3d5a4661e6
2 changed files with 31 additions and 36 deletions

View File

@ -9,34 +9,26 @@ var fs = require('fs'),
gzip = require('gulp-gzip'), gzip = require('gulp-gzip'),
rename = require('gulp-rename'); rename = require('gulp-rename');
// Get and install PHP Composer var composer = require("gulp-composer"),
gulp.task('get-composer', function(callback) { gutils = require("gulp-util");
// Check if Composer already in place
if (fs.existsSync('./composer.phar')) {
callback(null);
return; // ...
}
// Get installer from the internet composer("init", { "no-interaction": true });
https.get('https://getcomposer.org/installer', function(response) { composer('require maknz/slack', {});
// Run PHP to install Composer
var php = exec('php', function(error, stdout, stderr) { if (gutils.env.production) {
callback(error ? stderr : null); composer({
}); "bin": "/build/share/composer.phar",
// Pass installer code to PHP via STDIN "no-ansi": true,
response.pipe(php.stdin); "self-install": false,
}); });
}); } else {
//default install
composer();
}
// Install Composer dependencies gulp.task('prepare-release', function() {
gulp.task('composer-install', ['get-composer'], function(callback) {
exec('php -d "suhosin.executor.include.whitelist = phar" composer.phar install --no-dev', function(error, stdout, stderr) {
callback(error ? stderr : null);
});
});
gulp.task('prepare-release', ['composer-install'], function() {
var version = require('./package.json').version; var version = require('./package.json').version;
return eventStream.merge( return eventStream.merge(
@ -65,8 +57,7 @@ var getSources = function() {
'Plugin.php', 'Plugin.php',
'README.md', 'README.md',
'LICENSE', 'LICENSE',
'db/.htaccess', './vendor/**/*.*'
'vendor/**/*.*'
], ],
{base: './'} {base: './'}
) )

View File

@ -1,12 +1,16 @@
{ {
"version": "1.0.0", "version": "1.0.0",
"devDependencies": { "devDependencies": {
"gulp": "~3.8.10", "event-stream": "~3.1.7",
"event-stream": "~3.1.7", "gulp": "~3.8.10",
"gulp-zip": "~2.0.2", "gulp-chmod": "~1.2.0",
"gulp-tar": "~1.3.1", "gulp-composer": "^0.4.0",
"gulp-gzip": "~0.0.8", "gulp-gzip": "~0.0.8",
"gulp-chmod": "~1.2.0", "gulp-rename": "~1.2.0",
"gulp-rename": "~1.2.0" "gulp-tar": "~1.3.1",
} "gulp-zip": "~2.0.2",
"gulp-composer":"*",
"gulp-util": "*"
}
} }