Skip to content

Commit

Permalink
make perms non windows
Browse files Browse the repository at this point in the history
  • Loading branch information
t-aleksander committed Jan 16, 2025
1 parent d4fb8fe commit 0419034
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions src-tauri/cli/src/bin/dg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,16 +89,19 @@ impl CliConfig {
));
}
};
let mut perms = file
.metadata()
.map_err(|err| {
#[cfg(not(windows))]
{
let mut perms = file
.metadata()
.map_err(|err| {
CliError::ConfigSave(path.to_string_lossy().to_string(), err.to_string())
})?
.permissions();
perms.set_mode(0o600);
file.set_permissions(perms).map_err(|err| {
CliError::ConfigSave(path.to_string_lossy().to_string(), err.to_string())
})?
.permissions();
perms.set_mode(0o600);
file.set_permissions(perms).map_err(|err| {
CliError::ConfigSave(path.to_string_lossy().to_string(), err.to_string())
})?;
})?;
}
match serde_json::to_writer(file, &self) {
Ok(()) => debug!(
"Configuration file has been saved to {}",
Expand Down

0 comments on commit 0419034

Please sign in to comment.