Skip to content

Commit

Permalink
CreateOrMergeNixConfig: don't error when mode is different
Browse files Browse the repository at this point in the history
When we write out the new or merged config, we'll set it to our expected
mode anyways, so there's no need to error if it's different.
  • Loading branch information
cole-h committed Dec 9, 2024
1 parent 32487d8 commit b12d6f9
Showing 1 changed file with 0 additions and 13 deletions.
13 changes: 0 additions & 13 deletions src/action/base/create_or_merge_nix_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,19 +147,6 @@ impl CreateOrMergeNixConfig {
return Err(Self::error(ActionErrorKind::PathWasNotFile(path)));
}

// Does the file have the right permissions?
let discovered_mode = metadata.permissions().mode();
// We only care about user-group-other permissions
let discovered_mode = discovered_mode & 0o777;

if discovered_mode != NIX_CONF_MODE {
return Err(Self::error(ActionErrorKind::PathModeMismatch(
path,
discovered_mode,
NIX_CONF_MODE,
)));
}

let existing_nix_config = NixConfig::parse_file(&path)
.map_err(CreateOrMergeNixConfigError::ParseNixConfig)
.map_err(Self::error)?;
Expand Down

0 comments on commit b12d6f9

Please sign in to comment.