diff options
| author | Ryan Dahl <ry@tinyclouds.org> | 2018-10-27 06:11:39 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-10-27 06:11:39 -0700 |
| commit | 6adc87e3eb6193fd739b28931c19cf850c9b3276 (patch) | |
| tree | c2e193d19474d1638875aa840cdeb14e6aadec97 /tools/permission_prompt_test.ts | |
| parent | 7f204b980318215785aac8250351d24fda458f98 (diff) | |
Ergonomics: Prompt TTY for permission escalation (#1081)
Diffstat (limited to 'tools/permission_prompt_test.ts')
| -rw-r--r-- | tools/permission_prompt_test.ts | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/tools/permission_prompt_test.ts b/tools/permission_prompt_test.ts new file mode 100644 index 000000000..cf8a09805 --- /dev/null +++ b/tools/permission_prompt_test.ts @@ -0,0 +1,21 @@ +import { args, listen, env, exit, makeTempDirSync } from "deno"; + +const name = args[1]; +const test = { + needsWrite: () => { + makeTempDirSync(); + }, + needsEnv: () => { + env().home; + }, + needsNet: () => { + listen("tcp", "127.0.0.1:4540"); + } +}[name]; + +if (!test) { + console.log("Unknown test:", name); + exit(1); +} + +test(); |
