Skip to content
Snippets Groups Projects
Unverified Commit 50528955 authored by syuilo's avatar syuilo Committed by GitHub
Browse files

Refactor

parent d8f8730a
No related branches found
No related tags found
No related merge requests found
......@@ -266,11 +266,11 @@ export default (user: any, file: string | stream.Readable, ...args) => new Promi
}
rej(new Error('un-compatible file.'));
})
.then(([path, remove]): Promise<any> => new Promise((res, rej) => {
.then(([path, shouldCleanup]): Promise<any> => new Promise((res, rej) => {
addFile(user, path, ...args)
.then(file => {
res(file);
if (remove) {
if (shouldCleanup) {
fs.unlink(path, (e) => {
if (e) log(e.stack);
});
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment