2021-04-09 18:12:00 -04:00
|
|
|
const status1 =
|
|
|
|
(await Deno.permissions.request({ name: "run", command: "ls" })).state;
|
2021-09-09 08:38:47 -04:00
|
|
|
if (status1 != "granted") {
|
|
|
|
throw Error(`unexpected status1 ${status1}`);
|
|
|
|
}
|
2021-04-09 18:12:00 -04:00
|
|
|
const status2 =
|
|
|
|
(await Deno.permissions.query({ name: "run", command: "cat" })).state;
|
2021-09-09 08:38:47 -04:00
|
|
|
if (status2 != "prompt") {
|
|
|
|
throw Error(`unexpected status2 ${status2}`);
|
|
|
|
}
|
2021-04-09 18:12:00 -04:00
|
|
|
const status3 =
|
|
|
|
(await Deno.permissions.request({ name: "run", command: "cat" })).state;
|
2021-09-09 08:38:47 -04:00
|
|
|
if (status3 != "denied") {
|
|
|
|
throw Error(`unexpected status3 ${status3}`);
|
|
|
|
}
|
2021-04-09 18:12:00 -04:00
|
|
|
console.log(status1);
|
|
|
|
console.log(status2);
|
|
|
|
console.log(status3);
|