Skip to content

Commit 50a0917

Browse files
committed
修复Linux下的编译错误
1 parent e355daa commit 50a0917

3 files changed

Lines changed: 3 additions & 6 deletions

File tree

src/ops/caddy.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -238,10 +238,7 @@ pub async fn upgrade(config: &Config) -> Result<(), anyhow::Error> {
238238
fs::write(&path, contents).await?;
239239

240240
#[cfg(not(windows))]
241-
chmod_exec(path).await?;
242-
243-
#[cfg(not(windows))]
244-
use super::super::spawn_command;
241+
crate::utils::chmod_exec(path).await?;
245242

246243
#[cfg(not(windows))]
247244
{

src/ops/hugo.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ impl Hugo {
133133
fs::write(&path, contents).await?;
134134

135135
#[cfg(not(windows))]
136-
chmod_exec(path).await?;
136+
crate::utils::chmod_exec(path).await?;
137137
}
138138
}
139139

src/utils.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ pub fn unzip(z: &[u8], e_name: &str) -> Result<(OsString, Vec<u8>), anyhow::Erro
7474
pub async fn chmod_exec(path: impl AsRef<std::path::Path>) -> Result<(), anyhow::Error> {
7575
tracing::info!("正在设置执行权限……");
7676
use std::{fs::Permissions, os::unix::prelude::PermissionsExt};
77-
Ok(fs::set_permissions(path, Permissions::from_mode(0o755)).await?)
77+
Ok(tokio::fs::set_permissions(path, Permissions::from_mode(0o755)).await?)
7878
}
7979

8080
pub async fn spawn_command(cmd: &mut Command, hint: &str) -> Result<(), anyhow::Error> {

0 commit comments

Comments
 (0)