nixenv: filter out user setting warninsg too

This commit is contained in:
Graham Christensen 2020-03-30 16:58:09 -04:00
parent a2bbc8d258
commit 9f70ab9c13
No known key found for this signature in database
GPG key ID: FE918C3A98C1030F
2 changed files with 2 additions and 1 deletions

View file

@ -353,7 +353,7 @@ fn lines_from_file(file: fs::File) -> Vec<String> {
.collect()
}
fn is_user_setting_warning(line: &str) -> bool {
pub fn is_user_setting_warning(line: &str) -> bool {
let line = line.trim();
line.starts_with("warning: ignoring the user-specified setting '")
&& line.ends_with("because it is a restricted setting and you are not a trusted user")

View file

@ -43,6 +43,7 @@ impl HydraNixEnv {
.collect::<Result<Vec<String>, _>>()?
.into_iter()
.filter(|msg| msg.trim().len() > 0)
.filter(|line| !nix::is_user_setting_warning(line))
.collect::<Vec<String>>();
if evaluation_errors.len() > 0 {