1
1
mirror of https://github.com/kokonect-link/cherrypick synced 2024-10-31 15:21:46 +09:00
This commit is contained in:
otofune 2017-11-14 05:12:48 +09:00
parent d8a3b4ff1d
commit aabfe3c873

View File

@ -213,14 +213,14 @@ export default (user: any, file: string | stream.Readable, ...args) => new Promi
}).then(([path, remove]): Promise<any> => new Promise((res, rej) => { }).then(([path, remove]): Promise<any> => new Promise((res, rej) => {
addFile(user, path, ...args) addFile(user, path, ...args)
.then(file => { .then(file => {
res(file) res(file);
if (remove) { if (remove) {
fs.unlink(path, (e) => { fs.unlink(path, (e) => {
if (e) log(e.stack) if (e) log(e.stack);
}) });
} }
}) })
.catch(rej) .catch(rej);
})) }))
.then(file => { .then(file => {
log(`drive file has been created ${file._id}`); log(`drive file has been created ${file._id}`);