mirror of
https://iceshrimp.dev/limepotato/jormungandr-bite.git
synced 2024-11-15 14:37:36 -07:00
Refactor
This commit is contained in:
parent
f33b589401
commit
19edff6054
1 changed files with 3 additions and 3 deletions
|
@ -19,7 +19,7 @@ export default async (url, user, folderId = null, uri = null): Promise<IDriveFil
|
||||||
log(`name: ${name}`);
|
log(`name: ${name}`);
|
||||||
|
|
||||||
// Create temp file
|
// Create temp file
|
||||||
const path = await new Promise((res: (string) => void, rej) => {
|
const path = await new Promise<string>((res, rej) => {
|
||||||
tmp.file((e, path) => {
|
tmp.file((e, path) => {
|
||||||
if (e) return rej(e);
|
if (e) return rej(e);
|
||||||
res(path);
|
res(path);
|
||||||
|
@ -44,8 +44,8 @@ export default async (url, user, folderId = null, uri = null): Promise<IDriveFil
|
||||||
log(`created: ${driveFile._id}`);
|
log(`created: ${driveFile._id}`);
|
||||||
|
|
||||||
// clean-up
|
// clean-up
|
||||||
fs.unlink(path, (e) => {
|
fs.unlink(path, e => {
|
||||||
if (e) log(e.stack);
|
if (e) console.error(e);
|
||||||
});
|
});
|
||||||
|
|
||||||
return driveFile;
|
return driveFile;
|
||||||
|
|
Loading…
Reference in a new issue