File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -34,13 +34,14 @@ struct Unlink: SwiftlyCommand {
3434 var pathChanged = false
3535 if let proxyTo = try ? await Swiftly . currentPlatform. findSwiftlyBin ( ctx) {
3636 let swiftlyBinDir = Swiftly . currentPlatform. swiftlyBinDir ( ctx)
37- let swiftlyBinDirContents = ( try ? FileManager . default . contentsOfDirectory ( atPath: swiftlyBinDir. string ) ) ?? [ String] ( )
37+ let swiftlyBinDirContents = ( try ? await fs . ls ( atPath: swiftlyBinDir) ) ?? [ String] ( )
3838
39- let existingProxies = swiftlyBinDirContents. filter { bin in
40- do {
41- let linkTarget = try FileManager . default. destinationOfSymbolicLink ( atPath: ( swiftlyBinDir / bin) . string)
42- return linkTarget == proxyTo. string
43- } catch { return false }
39+ var existingProxies = [ String] ( )
40+ for bin in swiftlyBinDirContents {
41+ let linkTarget = try ? await fs. readlink ( atPath: swiftlyBinDir / bin)
42+ if linkTarget == proxyTo {
43+ existingProxies. append ( bin)
44+ }
4445 }
4546
4647 for p in existingProxies {
You can’t perform that action at this time.
0 commit comments