mirror of
https://github.com/denoland/deno.git
synced 2025-01-08 15:19:40 -05:00
chore(tools): Fix stdout buffer of launched process getting full causing tools/lint.js to hang on Windows (#10888)
Also fix Windows only clippy issues.
This commit is contained in:
parent
8e96961f0e
commit
6ee983b127
2 changed files with 8 additions and 5 deletions
|
@ -605,17 +605,20 @@ impl UnaryPermission<EnvDescriptor> {
|
||||||
|
|
||||||
pub fn request(&mut self, env: Option<&str>) -> PermissionState {
|
pub fn request(&mut self, env: Option<&str>) -> PermissionState {
|
||||||
if let Some(env) = env {
|
if let Some(env) = env {
|
||||||
#[cfg(windows)]
|
let env = if cfg!(windows) {
|
||||||
let env = env.to_uppercase();
|
env.to_uppercase()
|
||||||
|
} else {
|
||||||
|
env.to_string()
|
||||||
|
};
|
||||||
let state = self.query(Some(&env));
|
let state = self.query(Some(&env));
|
||||||
if state == PermissionState::Prompt {
|
if state == PermissionState::Prompt {
|
||||||
if permission_prompt(&format!("env access to \"{}\"", env)) {
|
if permission_prompt(&format!("env access to \"{}\"", env)) {
|
||||||
self.granted_list.retain(|env_| env_.0 != env);
|
self.granted_list.retain(|env_| env_.0 != env);
|
||||||
self.granted_list.insert(EnvDescriptor(env.to_string()));
|
self.granted_list.insert(EnvDescriptor(env));
|
||||||
PermissionState::Granted
|
PermissionState::Granted
|
||||||
} else {
|
} else {
|
||||||
self.denied_list.retain(|env_| env_.0 != env);
|
self.denied_list.retain(|env_| env_.0 != env);
|
||||||
self.denied_list.insert(EnvDescriptor(env.to_string()));
|
self.denied_list.insert(EnvDescriptor(env));
|
||||||
self.global_state = PermissionState::Denied;
|
self.global_state = PermissionState::Denied;
|
||||||
PermissionState::Denied
|
PermissionState::Denied
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,12 +17,12 @@ async function getFilesFromGit(baseDir, cmd) {
|
||||||
cmd,
|
cmd,
|
||||||
stdout: "piped",
|
stdout: "piped",
|
||||||
});
|
});
|
||||||
|
const output = new TextDecoder().decode(await p.output());
|
||||||
const { success } = await p.status();
|
const { success } = await p.status();
|
||||||
if (!success) {
|
if (!success) {
|
||||||
throw new Error("gitLsFiles failed");
|
throw new Error("gitLsFiles failed");
|
||||||
}
|
}
|
||||||
|
|
||||||
const output = new TextDecoder().decode(await p.output());
|
|
||||||
p.close();
|
p.close();
|
||||||
|
|
||||||
const files = output.split("\0").filter((line) => line.length > 0).map(
|
const files = output.split("\0").filter((line) => line.length > 0).map(
|
||||||
|
|
Loading…
Reference in a new issue