This repository has been archived on 2024-01-16. You can view files and clone it, but cannot push or open issues or pull requests.
Files
Maneger/test/index.ts

17 lines
543 B
TypeScript

import download from "./download";
import start from "./start";
const functionToRun: Array<(done: (done?: Error) => any) => Promise<void>> = [download, start];
(async () => {
for (const done of functionToRun) {
await new Promise((resolve, reject) => {
const Run = done((error) => {
if (error) return reject(error);
resolve("");
});
return Run.then(resolve).catch(reject);
});
}
})().then(() => process.exit(0)).catch((error) => {
console.error("Error: %s", String(error));
process.exit(1);
});