From 3d5a4661e642c1cff56105785aa627b4b1b75ea6 Mon Sep 17 00:00:00 2001 From: Derek McDaniel Date: Tue, 24 Jan 2017 23:31:10 -0500 Subject: [PATCH] Finished up package.js and gulpfile.js fixes --- gulpfile.js | 43 +++++++++++++++++-------------------------- package.json | 24 ++++++++++++++---------- 2 files changed, 31 insertions(+), 36 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index f6cd46d..41f4c24 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -9,34 +9,26 @@ var fs = require('fs'), gzip = require('gulp-gzip'), rename = require('gulp-rename'); -// Get and install PHP Composer -gulp.task('get-composer', function(callback) { - // Check if Composer already in place - if (fs.existsSync('./composer.phar')) { - callback(null); +var composer = require("gulp-composer"), + gutils = require("gulp-util"); - return; - } +// ... - // Get installer from the internet - https.get('https://getcomposer.org/installer', function(response) { - // Run PHP to install Composer - var php = exec('php', function(error, stdout, stderr) { - callback(error ? stderr : null); - }); - // Pass installer code to PHP via STDIN - response.pipe(php.stdin); +composer("init", { "no-interaction": true }); +composer('require maknz/slack', {}); + +if (gutils.env.production) { + composer({ + "bin": "/build/share/composer.phar", + "no-ansi": true, + "self-install": false, }); -}); +} else { + //default install + composer(); +} -// Install Composer dependencies -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() { +gulp.task('prepare-release', function() { var version = require('./package.json').version; return eventStream.merge( @@ -65,8 +57,7 @@ var getSources = function() { 'Plugin.php', 'README.md', 'LICENSE', - 'db/.htaccess', - 'vendor/**/*.*' + './vendor/**/*.*' ], {base: './'} ) diff --git a/package.json b/package.json index e7141d4..9b5a11d 100644 --- a/package.json +++ b/package.json @@ -1,12 +1,16 @@ { - "version": "1.0.0", - "devDependencies": { - "gulp": "~3.8.10", - "event-stream": "~3.1.7", - "gulp-zip": "~2.0.2", - "gulp-tar": "~1.3.1", - "gulp-gzip": "~0.0.8", - "gulp-chmod": "~1.2.0", - "gulp-rename": "~1.2.0" - } + "version": "1.0.0", + "devDependencies": { + "event-stream": "~3.1.7", + "gulp": "~3.8.10", + "gulp-chmod": "~1.2.0", + "gulp-composer": "^0.4.0", + "gulp-gzip": "~0.0.8", + "gulp-rename": "~1.2.0", + "gulp-tar": "~1.3.1", + "gulp-zip": "~2.0.2", + "gulp-composer":"*", + "gulp-util": "*" + + } }