Skip to content

Commit

Permalink
Resolve #50
Browse files Browse the repository at this point in the history
Support for glob in "file exist"-check
  • Loading branch information
Danni Larsen committed Nov 14, 2016
1 parent 4c8a07e commit 9021f43
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
25 changes: 12 additions & 13 deletions gulp/tasks/scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const gulp = require('gulp');
const config = require('../config.js');
const mergeStream = require('merge-stream');
var notifier = require('node-notifier');
var fs = require('fs');
var checkFilesExist = require('check-files-exist');
var plugins = require('gulp-load-plugins')();

// Tasks
Expand Down Expand Up @@ -43,18 +43,17 @@ var compileScripts = function(isWatchTask){
var useSourcemaps = ignores.indexOf("sourcemaps") == -1;
var useMinify = ignores.indexOf("minify") == -1;

b.scripts.forEach(function(file) {
fs.stat(file, function(err, stat) {
if(err != null) {
notifier.notify({
"title": "scripts",
"message": "File not found."
});
console.log(err.message);
notifier.emit("end");
}
});
});
checkFilesExist(b.scripts).then(
function () {},
function (err) {
notifier.notify({
"title": "scripts",
"message": "File not found."
});
console.log(err.message);
notifier.emit("end");
}
);

return gulp.src(b.scripts)
.pipe(plugins.resolveDependencies({ pattern: /\* @require [\s-]*(.*?\.js)/g }))
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
],
"license": "MIT",
"devDependencies": {
"check-files-exist": "^1.0.1",
"del": "^2.2.1",
"es6-promise": "^3.2.1",
"glob": "^7.1.1",
Expand Down Expand Up @@ -97,4 +98,4 @@
"tsd.json",
"tslint.json"
]
}
}

0 comments on commit 9021f43

Please sign in to comment.