@@ -11,7 +11,7 @@ import SwiftShell
1111
1212public extension File {
1313
14- public func nameWithSuffix( _ suffix: String ) -> String {
14+ func nameWithSuffix( _ suffix: String ) -> String {
1515 if let unwrappedExtension = `extension` {
1616 return nameExcludingExtension + suffix + " . " + unwrappedExtension
1717 }
@@ -23,7 +23,7 @@ public extension File {
2323 ////////////////////////////////////////////////////////////////////////////////
2424 // MARK: - Duplication
2525
26- @discardableResult public func createDuplicate( withName newName: String , keepExtension: Bool = true , overwrite: Bool = true ) throws -> File ? {
26+ @discardableResult func createDuplicate( withName newName: String , keepExtension: Bool = true , overwrite: Bool = true ) throws -> File ? {
2727 if !overwrite && FileManager . default. fileExists ( atPath: newName) { return nil }
2828
2929 guard let parent = parent else {
@@ -55,7 +55,7 @@ public extension File {
5555 ////////////////////////////////////////////////////////////////////////////////
5656 // MARK: - Modification date
5757
58- public func modificationDate( ) throws -> Date {
58+ func modificationDate( ) throws -> Date {
5959
6060 let fileAttributes = try FileManager . default. attributesOfItem ( atPath: path) as [ FileAttributeKey : Any ]
6161 let modificationDate = fileAttributes [ . modificationDate] as! Date
@@ -66,7 +66,7 @@ public extension File {
6666 ////////////////////////////////////////////////////////////////////////////////
6767 // MARK: - Tag file
6868
69- public func tag( copy: Bool ) throws {
69+ func tag( copy: Bool ) throws {
7070 let date = try modificationDate ( )
7171 let suffix = ScriptToolkit . dateFormatter. string ( from: date)
7272 for letter in " abcdefghijklmnopqrstuvwxyz " {
@@ -123,13 +123,13 @@ public extension File {
123123 ////////////////////////////////////////////////////////////////////////////////
124124 // MARK: - Resize image
125125
126- @discardableResult public func resizeImage( newName: String , size: CGSize , overwrite: Bool = true ) throws -> File {
126+ @discardableResult func resizeImage( newName: String , size: CGSize , overwrite: Bool = true ) throws -> File {
127127 if !overwrite && FileManager . default. fileExists ( atPath: newName) { return try File ( path: newName) }
128128 run ( ScriptToolkit . convertPath, path, " -resize " , " \( Int ( size. width) ) x \( Int ( size. height) ) " , newName)
129129 return try File ( path: newName)
130130 }
131131
132- public func resizeAt123x( width: Int , height: Int , outputDir: Folder , overwrite: Bool = true ) throws {
132+ func resizeAt123x( width: Int , height: Int , outputDir: Folder , overwrite: Bool = true ) throws {
133133 print ( name)
134134
135135 let res1name = outputDir. path. appendingPathComponent ( path: name)
@@ -145,7 +145,7 @@ public extension File {
145145 ////////////////////////////////////////////////////////////////////////////////
146146 // MARK: - Audio Processing
147147
148- @discardableResult public func slowDownAudio( newName: String , percent: Float , overwrite: Bool = true ) throws -> File {
148+ @discardableResult func slowDownAudio( newName: String , percent: Float , overwrite: Bool = true ) throws -> File {
149149 if FileManager . default. fileExists ( atPath: newName) {
150150 if !overwrite { return try File ( path: newName) }
151151 try FileManager . default. removeItem ( atPath: newName)
@@ -155,7 +155,7 @@ public extension File {
155155 return try File ( path: newName)
156156 }
157157
158- @discardableResult public func convertToWav( newName: String , overwrite: Bool = true ) throws -> File {
158+ @discardableResult func convertToWav( newName: String , overwrite: Bool = true ) throws -> File {
159159 if FileManager . default. fileExists ( atPath: newName) {
160160 if !overwrite { return try File ( path: newName) }
161161 try FileManager . default. removeItem ( atPath: newName)
@@ -165,7 +165,7 @@ public extension File {
165165 return try File ( path: newName)
166166 }
167167
168- @discardableResult public func normalizeSampleRate( newName: String , overwrite: Bool = true ) throws -> File {
168+ @discardableResult func normalizeSampleRate( newName: String , overwrite: Bool = true ) throws -> File {
169169 if FileManager . default. fileExists ( atPath: newName) {
170170 if !overwrite { return try File ( path: newName) }
171171 try FileManager . default. removeItem ( atPath: newName)
@@ -175,7 +175,7 @@ public extension File {
175175 return try File ( path: newName)
176176 }
177177
178- @discardableResult public func convertToM4A( newName: String , overwrite: Bool = true ) throws -> File {
178+ @discardableResult func convertToM4A( newName: String , overwrite: Bool = true ) throws -> File {
179179 if FileManager . default. fileExists ( atPath: newName) {
180180 if !overwrite { return try File ( path: newName) }
181181 try FileManager . default. removeItem ( atPath: newName)
@@ -185,13 +185,13 @@ public extension File {
185185 return try File ( path: newName)
186186 }
187187
188- @discardableResult public func addSilence( newName: String , overwrite: Bool = true ) throws -> File {
188+ @discardableResult func addSilence( newName: String , overwrite: Bool = true ) throws -> File {
189189 if FileManager . default. fileExists ( atPath: newName) {
190190 if !overwrite { return try File ( path: newName) }
191191 try FileManager . default. removeItem ( atPath: newName)
192192 }
193193
194- let result = runAndDebug ( ScriptToolkit . soxPath, ScriptToolkit . silenceFilePath, path, newName)
194+ runAndDebug ( ScriptToolkit . soxPath, ScriptToolkit . silenceFilePath, path, newName)
195195 return try File ( path: newName)
196196 }
197197
@@ -259,7 +259,7 @@ public extension File {
259259 ////////////////////////////////////////////////////////////////////////////////
260260 // MARK: - Video Processing
261261
262- @discardableResult public func reduceVideo( newName: String , overwrite: Bool = true ) throws -> File {
262+ @discardableResult func reduceVideo( newName: String , overwrite: Bool = true ) throws -> File {
263263 if FileManager . default. fileExists ( atPath: newName) {
264264 if !overwrite { return try File ( path: newName) }
265265 try FileManager . default. removeItem ( atPath: newName)
@@ -272,7 +272,7 @@ public extension File {
272272 ////////////////////////////////////////////////////////////////////////////////
273273 // MARK: - PDF
274274
275- @discardableResult public func cropPDF( newName: String , insets: NSEdgeInsets , overwrite: Bool = true ) throws -> File {
275+ @discardableResult func cropPDF( newName: String , insets: NSEdgeInsets , overwrite: Bool = true ) throws -> File {
276276 if FileManager . default. fileExists ( atPath: newName) {
277277 if !overwrite { return try File ( path: newName) }
278278 try FileManager . default. removeItem ( atPath: newName)
0 commit comments