Fixed double dir path component extraction in save module (causing profile info save to fail).

This commit is contained in:
ThePendulum 2018-04-27 00:42:11 +02:00
parent 11d702d322
commit 88425aee5b
1 changed files with 1 additions and 1 deletions

View File

@ -11,7 +11,7 @@ function save(filepath, streams, item) {
streams = [].concat(streams); streams = [].concat(streams);
return Promise.resolve().then(() => { return Promise.resolve().then(() => {
return fs.ensureDir(path.dirname(pathComponents.dir)); return fs.ensureDir(pathComponents.dir);
}).then(() => { }).then(() => {
return Promise.all(streams.map((stream, index) => { return Promise.all(streams.map((stream, index) => {
const target = streams.length > 1 ? path.join(pathComponents.dir, `${pathComponents.name}-${index}${pathComponents.ext}`) : filepath; const target = streams.length > 1 ? path.join(pathComponents.dir, `${pathComponents.name}-${index}${pathComponents.ext}`) : filepath;