1
0
Fork 0
fetch-compare/src/platform-deno.ts

21 lines
557 B
TypeScript
Raw Normal View History

2021-09-10 00:22:43 +08:00
import cp from 'child_process';
2021-09-09 23:47:04 +08:00
// @ts-expect-error: Missing types
import {binary} from 'deno-prebuilt';
import {Platform, Result} from './types.js';
export default class PlatformDeno implements Platform {
async run(): Promise<Result> {
throw new Error('not implemented');
2021-09-10 00:07:54 +08:00
/* eslint-disable no-unreachable */
const child = cp.spawn(binary, []);
await new Promise((resolve, reject) => {
child.once('error', reject);
2021-09-10 00:37:10 +08:00
child.once('exit', reject);
2021-09-10 00:07:54 +08:00
child.once('spawn', resolve);
});
child.kill();
/* eslint-enable no-unreachable */
2021-09-09 23:47:04 +08:00
}
}