mirror of
https://github.com/atuinsh/atuin.git
synced 2025-06-20 18:07:57 +02:00
fix(windows): disables unix specific stuff for windows (#1557)
* fix(windows): disables unix specific stuff for windows (windows has this on by default iirc) * refactor: use windows not target_family
This commit is contained in:
parent
a56085f059
commit
33eedf93b6
@ -2,6 +2,7 @@ use clap::{CommandFactory, Subcommand};
|
|||||||
use clap_complete::{generate, generate_to, Shell};
|
use clap_complete::{generate, generate_to, Shell};
|
||||||
use eyre::Result;
|
use eyre::Result;
|
||||||
|
|
||||||
|
#[cfg(not(windows))]
|
||||||
use rustix::{fs::Mode, process::umask};
|
use rustix::{fs::Mode, process::umask};
|
||||||
|
|
||||||
#[cfg(feature = "client")]
|
#[cfg(feature = "client")]
|
||||||
@ -48,10 +49,13 @@ pub enum AtuinCmd {
|
|||||||
|
|
||||||
impl AtuinCmd {
|
impl AtuinCmd {
|
||||||
pub fn run(self) -> Result<()> {
|
pub fn run(self) -> Result<()> {
|
||||||
// set umask before we potentially open/create files
|
#[cfg(not(windows))]
|
||||||
// or in other words, 077. Do not allow any access to any other user
|
{
|
||||||
let mode = Mode::RWXG | Mode::RWXO;
|
// set umask before we potentially open/create files
|
||||||
umask(mode);
|
// or in other words, 077. Do not allow any access to any other user
|
||||||
|
let mode = Mode::RWXG | Mode::RWXO;
|
||||||
|
umask(mode);
|
||||||
|
}
|
||||||
|
|
||||||
match self {
|
match self {
|
||||||
#[cfg(feature = "client")]
|
#[cfg(feature = "client")]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user