-
Notifications
You must be signed in to change notification settings - Fork 2k
feat(gulp): Add gulp task mkdir:upload to ensure upload directory exi… #1199
Conversation
@@ -202,6 +203,11 @@ gulp.task('imagemin', function () { | |||
.pipe(gulp.dest('public/dist/img')); | |||
}); | |||
|
|||
// Make sure upload directory exists | |||
gulp.task('mkdir:upload', function () { | |||
return fs.mkdir('modules/users/client/img/profile/uploads', function () { }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rhutchison need to handle a possible error here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Error is handled with noop - how do you want it to be handled?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
log it or something maybe? We basically need to notify users of it at the least.
5f0c9b8
to
4d9a444
Compare
@@ -218,6 +218,15 @@ gulp.task('copyLocalEnvConfig', function () { | |||
.pipe(gulp.dest('config/env')); | |||
}); | |||
|
|||
// Make sure upload directory exists | |||
gulp.task('makeUploadsDir', function () { | |||
return fs.mkdir('modules/users/client/img/profile/uploads', function (res) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpick, res should be err (convention)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where is this convention defined?
This is a callback method for success/error and is not specifically a callback only for errors.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a common node convention for callbacks to return an error, so err makes more sense.
Also, the scope of the commit message should be gulp, because this is gulp-related, not really "core". |
4d9a444
to
4a298b4
Compare
@ilanbiala scope is updated to reflect your feedback |
4a298b4
to
6cacc15
Compare
@ilanbiala LGTY? |
Closing/Opening to produce clean build. One node timed out. |
feat(gulp): Add gulp task mkdir:upload to ensure upload directory exi…
…sts.
Related #1175