File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed
Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change @@ -75,6 +75,37 @@ public class Extractor
7575 {
7676 progress ? ( $0 + 1 , $1 )
7777 }
78+
79+ self . setFilesAsExecutable ( in: destination )
80+ }
81+
82+ private func setFilesAsExecutable( in directory: URL )
83+ {
84+ guard let enumerator = FileManager . default. enumerator ( at: directory, includingPropertiesForKeys: nil )
85+ else
86+ {
87+ return
88+ }
89+
90+ enumerator. forEach
91+ {
92+ guard let file = $0 as? URL
93+ else
94+ {
95+ return
96+ }
97+
98+ var isDir : ObjCBool = false
99+
100+ if FileManager . default. fileExists ( atPath: file. path ( percentEncoded: false ) , isDirectory: & isDir ) , isDir. boolValue == false
101+ {
102+ let attributes : [ FileAttributeKey : Any ] = [
103+ . posixPermissions: 0o755
104+ ]
105+
106+ try ? FileManager . default. setAttributes ( attributes, ofItemAtPath: file. path ( percentEncoded: false ) )
107+ }
108+ }
78109 }
79110
80111 private func recylce( url: URL ) throws
You can’t perform that action at this time.
0 commit comments