mirror of
https://github.com/denoland/deno.git
synced 2025-09-26 12:19:12 +00:00
reorg: remove dispatch.ts, move signals, factor out web utils (#4316)
- moves signal definition from "cli/js/process.ts" to "cli/js/signals.ts" - removes "cli/js/dispatch.ts" - removes "cli/js/types.ts" - moves web specific utilities to "cli/js/web/util.ts"
This commit is contained in:
parent
99a0c6df79
commit
2d1b39bef3
20 changed files with 188 additions and 199 deletions
|
@ -3,7 +3,6 @@ import { File } from "./files.ts";
|
|||
import { close } from "./ops/resources.ts";
|
||||
import { ReadCloser, WriteCloser } from "./io.ts";
|
||||
import { readAll } from "./buffer.ts";
|
||||
import { build } from "./build.ts";
|
||||
import { kill, runStatus as runStatusOp, run as runOp } from "./ops/process.ts";
|
||||
|
||||
/** How to handle subprocess stdio.
|
||||
|
@ -161,85 +160,3 @@ export function run({
|
|||
}) as RunResponse;
|
||||
return new Process(res);
|
||||
}
|
||||
|
||||
// From `kill -l`
|
||||
enum LinuxSignal {
|
||||
SIGHUP = 1,
|
||||
SIGINT = 2,
|
||||
SIGQUIT = 3,
|
||||
SIGILL = 4,
|
||||
SIGTRAP = 5,
|
||||
SIGABRT = 6,
|
||||
SIGBUS = 7,
|
||||
SIGFPE = 8,
|
||||
SIGKILL = 9,
|
||||
SIGUSR1 = 10,
|
||||
SIGSEGV = 11,
|
||||
SIGUSR2 = 12,
|
||||
SIGPIPE = 13,
|
||||
SIGALRM = 14,
|
||||
SIGTERM = 15,
|
||||
SIGSTKFLT = 16,
|
||||
SIGCHLD = 17,
|
||||
SIGCONT = 18,
|
||||
SIGSTOP = 19,
|
||||
SIGTSTP = 20,
|
||||
SIGTTIN = 21,
|
||||
SIGTTOU = 22,
|
||||
SIGURG = 23,
|
||||
SIGXCPU = 24,
|
||||
SIGXFSZ = 25,
|
||||
SIGVTALRM = 26,
|
||||
SIGPROF = 27,
|
||||
SIGWINCH = 28,
|
||||
SIGIO = 29,
|
||||
SIGPWR = 30,
|
||||
SIGSYS = 31
|
||||
}
|
||||
|
||||
// From `kill -l`
|
||||
enum MacOSSignal {
|
||||
SIGHUP = 1,
|
||||
SIGINT = 2,
|
||||
SIGQUIT = 3,
|
||||
SIGILL = 4,
|
||||
SIGTRAP = 5,
|
||||
SIGABRT = 6,
|
||||
SIGEMT = 7,
|
||||
SIGFPE = 8,
|
||||
SIGKILL = 9,
|
||||
SIGBUS = 10,
|
||||
SIGSEGV = 11,
|
||||
SIGSYS = 12,
|
||||
SIGPIPE = 13,
|
||||
SIGALRM = 14,
|
||||
SIGTERM = 15,
|
||||
SIGURG = 16,
|
||||
SIGSTOP = 17,
|
||||
SIGTSTP = 18,
|
||||
SIGCONT = 19,
|
||||
SIGCHLD = 20,
|
||||
SIGTTIN = 21,
|
||||
SIGTTOU = 22,
|
||||
SIGIO = 23,
|
||||
SIGXCPU = 24,
|
||||
SIGXFSZ = 25,
|
||||
SIGVTALRM = 26,
|
||||
SIGPROF = 27,
|
||||
SIGWINCH = 28,
|
||||
SIGINFO = 29,
|
||||
SIGUSR1 = 30,
|
||||
SIGUSR2 = 31
|
||||
}
|
||||
|
||||
/** Signals numbers. This is platform dependent.
|
||||
*/
|
||||
export const Signal: { [key: string]: number } = {};
|
||||
|
||||
export function setSignals(): void {
|
||||
if (build.os === "mac") {
|
||||
Object.assign(Signal, MacOSSignal);
|
||||
} else {
|
||||
Object.assign(Signal, LinuxSignal);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue