Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

If destination folder does not exist, create it and continue #3

Merged
merged 1 commit into from

2 participants

D Budge gleero
D Budge

Creates a folder if the specified destination folder was not found.

Also updated path.existsSync to fs.existsSync as Grunt was outputting a log message to do so.

gleero gleero merged commit 7b81823 into from
gleero
Owner

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 3 additions and 4 deletions.
  1. +3 −4 tasks/favicons.js
7 tasks/favicons.js
View
@@ -84,9 +84,8 @@ module.exports = function(grunt) {
}
if (!grunt.file.isDir(f.dest)) {
- return grunt.warn (
- 'Dest "' + f.dest + '" in target "' + target + '" must be a directory and exists.'
- );
+ grunt.file.mkdir(f.dest);
+ grunt.log.ok('Created output folder at "', f.dest, '"');
}
// Iterate source files
@@ -108,7 +107,7 @@ module.exports = function(grunt) {
var p = path.join(dirname, basename + "." + size + ext);
var saveTo = path.join(f.dest, size + '.png');
var src = source;
- if (path.existsSync(p)) {
+ if (fs.existsSync(p)) {
src = p;
}
convert([src, '-resize', size, saveTo]);
Something went wrong with that request. Please try again.