Auto-fix executable permissions on discovered AppImages
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user