@@ -233,7 +233,7 @@ struct QuickPkg: AsyncParsableCommand {
233233 dmgManager: DMGManager ,
234234 archiveExtractor: ArchiveExtractor
235235 ) async throws -> URL {
236- guard FileManager . default . fileExists ( atPath : url. path ) else {
236+ guard url. fileExists else {
237237 throw QuickPkgError . fileNotFound ( url. path)
238238 }
239239
@@ -265,7 +265,7 @@ struct QuickPkg: AsyncParsableCommand {
265265
266266 if let scriptsPath = scripts {
267267 let scriptsURL = URL ( filePath: scriptsPath)
268- guard FileManager . default . fileExists ( atPath : scriptsPath ) else {
268+ guard scriptsURL . fileExists else {
269269 throw QuickPkgError . scriptNotFound ( scriptsPath)
270270 }
271271 scriptsDir = scriptsURL
@@ -301,11 +301,11 @@ struct QuickPkg: AsyncParsableCommand {
301301 /// Copy a script to the scripts directory with proper permissions
302302 private func copyScript( from sourcePath: String , to scriptsDir: URL , name: String , logger: Logger ) throws {
303303 let sourceURL = URL ( filePath: sourcePath)
304- guard FileManager . default . fileExists ( atPath : sourcePath ) else {
304+ guard sourceURL . fileExists else {
305305 throw QuickPkgError . scriptNotFound ( sourcePath)
306306 }
307307 let destURL = scriptsDir. appendingPathComponent ( name)
308- if FileManager . default . fileExists ( atPath : destURL. path ) {
308+ if destURL. fileExists {
309309 throw QuickPkgError . scriptConflict ( " \( name) script already exists in scripts folder " )
310310 }
311311 try FileManager . default. copyItem ( at: sourceURL, to: destURL)
@@ -319,7 +319,8 @@ struct QuickPkg: AsyncParsableCommand {
319319 var path : String
320320
321321 if let output = output {
322- if FileManager . default. fileExists ( atPath: output) ,
322+ let outputURL = URL ( filePath: output)
323+ if outputURL. fileExists,
323324 ( try ? FileManager . default. attributesOfItem ( atPath: output) [ . type] as? FileAttributeType ) == . typeDirectory {
324325 path = ( output as NSString ) . appendingPathComponent ( defaultName)
325326 } else {
0 commit comments