File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -122,7 +122,11 @@ module.exports = function (options) {
122
122
_ . each ( options . imageVersions , function ( value , version ) {
123
123
counter ++ ;
124
124
// creating directory recursive
125
- mkdirp ( options . uploadDir ( ) + '/' + version + '/' , function ( err , made ) {
125
+ // mkdirp(options.uploadDir() + '/' + version + '/', function (err, made) {
126
+
127
+ // });
128
+
129
+ mkdirp ( options . uploadDir ( ) + '/' + version + '/' ) . then ( made => {
126
130
var opts = options . imageVersions [ version ] ;
127
131
imageMagick . resize ( {
128
132
width : opts . width ,
@@ -132,11 +136,12 @@ module.exports = function (options) {
132
136
customArgs : opts . imageArgs || [ '-auto-orient' ]
133
137
} , finish ) ;
134
138
} ) ;
139
+
135
140
} ) ;
136
141
}
137
142
}
138
143
139
- mkdirp ( options . uploadDir ( ) + '/' , function ( err , made ) {
144
+ mkdirp ( options . uploadDir ( ) + '/' ) . then ( made => {
140
145
fs . rename ( file . path , options . uploadDir ( ) + '/' + fileInfo . name , function ( err ) {
141
146
if ( ! err ) {
142
147
generatePreviews ( ) ;
@@ -155,6 +160,7 @@ module.exports = function (options) {
155
160
}
156
161
} ) ;
157
162
} ) ;
163
+
158
164
}
159
165
else finish ( ) ;
160
166
} ) ;
You can’t perform that action at this time.
0 commit comments