lol
This commit is contained in:
parent
cf0494ac36
commit
59a274bc7a
17
index.js
17
index.js
@ -20,7 +20,9 @@ async function exec(...args) {
|
||||
});
|
||||
}
|
||||
|
||||
(async () => {
|
||||
const TMP_DIR = `/tmp/mudl_${Math.random().toString(36).substring(7)}`;
|
||||
|
||||
async function thing() {
|
||||
if (!process.argv[2]) {
|
||||
console.log('need a video');
|
||||
return;
|
||||
@ -30,7 +32,7 @@ async function exec(...args) {
|
||||
return item ? item.trim() : item;
|
||||
});
|
||||
|
||||
const dir = await tmp.dir({ prefix: 'mudl_', unsafeCleanup: true });
|
||||
const dir = await fs.mkdir(TMP_DIR);
|
||||
|
||||
let files = [];
|
||||
let inputType = null;
|
||||
@ -158,4 +160,13 @@ async function exec(...args) {
|
||||
console.log('Finished everything, cleaning up...');
|
||||
await dir.cleanup();
|
||||
console.log('Done!');
|
||||
})().catch(console.error);
|
||||
}
|
||||
|
||||
(async () => {
|
||||
try {
|
||||
await thing();
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
await fs.rmdir(TMP_DIR, { recursive: true });
|
||||
}
|
||||
})();
|
||||
|
@ -2,14 +2,10 @@
|
||||
"name": "mudl",
|
||||
"description": "nothing yet",
|
||||
"version": "1.0.2",
|
||||
"dependencies": {
|
||||
"fs-extra": "^7.0.1",
|
||||
"tmp-promise": "^1.0.5"
|
||||
},
|
||||
"bin": {
|
||||
"mudl": "index.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 11.0.0"
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user