Merge remote-tracking branch 'upstream/master'

This commit is contained in:
creme 2021-10-24 11:17:51 +02:00
commit 25dbb94f7e
Signed by: creme
GPG Key ID: C147C3B7FBDF08D0
1 changed files with 5 additions and 2 deletions

View File

@ -1,7 +1,7 @@
use std::io;
#[cfg(not(test))]
use std::{env, fs};
use std::{env, fs, os::unix::fs::PermissionsExt};
use crate::conf;
use crate::db;
@ -129,7 +129,10 @@ pub fn display() -> error::Result<()> {
{
let homedir = env::var("HOME")?;
let localdest = format!("{}/.clinte.json", homedir);
fs::copy(db::PATH, localdest)?;
fs::copy(db::PATH, localdest.clone())?;
let mut perms = fs::metadata(&localdest)?.permissions();
perms.set_mode(0o644);
fs::set_permissions(&localdest, perms)?;
}
Ok(())