Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow gulp command to check which jigsaw binary to use #85

Merged
merged 3 commits into from
Mar 28, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion site/gulpfile.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
var gulp = require('gulp');
var elixir = require('laravel-elixir');
var argv = require('yargs').argv;
var bin = require('./tasks/bin');

elixir.config.assetsPath = 'source/_assets';
elixir.config.publicPath = 'source';
Expand All @@ -10,11 +11,12 @@ elixir(function(mix) {
var port = argv.p || argv.port || 3000;

mix.sass('main.scss')
.exec('jigsaw build ' + env, ['./source/*', './source/**/*', '!./source/_assets/**/*'])
.exec(bin.path() + ' build ' + env, ['./source/*', './source/**/*', '!./source/_assets/**/*'])
.browserSync({
port: port,
server: { baseDir: 'build_' + env },
proxy: null,
files: [ 'build_' + env + '/**/*' ]
});
});

1 change: 1 addition & 0 deletions site/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"private": true,
"devDependencies": {
"gulp": "^3.8.8",
"hasbin": "^1.2.3",
"laravel-elixir": "^4.2.0",
"yargs": "^4.6.0"
}
Expand Down
18 changes: 18 additions & 0 deletions site/tasks/bin.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
var hasbin = require('hasbin');
var fs = require('fs');

module.exports = {
path: function() {
if (fs.existsSync('./vendor/bin/jigsaw')) {
return './vendor/bin/jigsaw'
}

if (hasbin.sync('jigsaw')) {
return 'jigsaw';
}

console.log('Could not find Jigsaw; please install it via Composer, either locally or globally.');

process.exit();
}
};