forked from lix-project/lix-installer
Set the correct permissions on the zshenv (#257)
* Set the correct permissions on the zshenv * Update error to suggest chmod instead of delete * Missed a formatting option * 644, not 755 * Get a bit more specific * Mac specific permissions
This commit is contained in:
parent
5582d050fc
commit
7e951a5b6a
|
@ -3,6 +3,7 @@ use crate::action::{Action, ActionDescription, ActionError, StatefulAction};
|
||||||
|
|
||||||
use nix::unistd::User;
|
use nix::unistd::User;
|
||||||
use std::path::{Path, PathBuf};
|
use std::path::{Path, PathBuf};
|
||||||
|
use target_lexicon::OperatingSystem;
|
||||||
use tokio::task::JoinSet;
|
use tokio::task::JoinSet;
|
||||||
use tracing::{span, Instrument, Span};
|
use tracing::{span, Instrument, Span};
|
||||||
|
|
||||||
|
@ -65,12 +66,22 @@ impl ConfigureShellProfile {
|
||||||
);
|
);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
// Macs require a different mode on certain files...
|
||||||
|
let required_mode = match target_lexicon::OperatingSystem::host() {
|
||||||
|
OperatingSystem::MacOSX {
|
||||||
|
major: _,
|
||||||
|
minor: _,
|
||||||
|
patch: _,
|
||||||
|
}
|
||||||
|
| OperatingSystem::Darwin => 0o100444,
|
||||||
|
_ => 0o100644,
|
||||||
|
};
|
||||||
create_or_insert_files.push(
|
create_or_insert_files.push(
|
||||||
CreateOrInsertIntoFile::plan(
|
CreateOrInsertIntoFile::plan(
|
||||||
profile_target_path,
|
profile_target_path,
|
||||||
None,
|
None,
|
||||||
None,
|
None,
|
||||||
None,
|
required_mode,
|
||||||
shell_buf.to_string(),
|
shell_buf.to_string(),
|
||||||
create_or_insert_into_file::Position::Beginning,
|
create_or_insert_into_file::Position::Beginning,
|
||||||
)
|
)
|
||||||
|
@ -112,7 +123,7 @@ impl ConfigureShellProfile {
|
||||||
profile_target,
|
profile_target,
|
||||||
None,
|
None,
|
||||||
None,
|
None,
|
||||||
0o0755,
|
0o100644,
|
||||||
fish_buf.to_string(),
|
fish_buf.to_string(),
|
||||||
create_or_insert_into_file::Position::Beginning,
|
create_or_insert_into_file::Position::Beginning,
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in a new issue