Auto-fix executable permissions on discovered AppImages

This commit is contained in:
lashman
2026-02-27 23:36:14 +02:00
parent 8dd0dc71ed
commit 4173f33bbf
2 changed files with 21 additions and 1 deletions

View File

@@ -106,7 +106,14 @@ fn scan_directory(dir: &Path) -> Vec<DiscoveredAppImage> {
.map(|n| n.to_string_lossy().into_owned())
.unwrap_or_default();
let is_executable = metadata.permissions().mode() & 0o111 != 0;
let mut is_executable = metadata.permissions().mode() & 0o111 != 0;
if !is_executable {
let perms = std::fs::Permissions::from_mode(0o755);
if std::fs::set_permissions(&path, perms).is_ok() {
is_executable = true;
log::info!("Auto-fixed executable permission: {}", path.display());
}
}
let modified_time = metadata.modified().ok();
results.push(DiscoveredAppImage {