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 @@ -31,13 +31,14 @@ struct Unlink: SwiftlyCommand {
3131 var pathChanged = false
3232 if let proxyTo = try ? await Swiftly . currentPlatform. findSwiftlyBin ( ctx) {
3333 let swiftlyBinDir = Swiftly . currentPlatform. swiftlyBinDir ( ctx)
34- let swiftlyBinDirContents = ( try ? FileManager . default . contentsOfDirectory ( atPath: swiftlyBinDir. string ) ) ?? [ String] ( )
34+ let swiftlyBinDirContents = ( try ? await fs . ls ( atPath: swiftlyBinDir) ) ?? [ String] ( )
3535
36- let existingProxies = swiftlyBinDirContents. filter { bin in
37- do {
38- let linkTarget = try FileManager . default. destinationOfSymbolicLink ( atPath: ( swiftlyBinDir / bin) . string)
39- return linkTarget == proxyTo. string
40- } catch { return false }
36+ var existingProxies = [ String] ( )
37+ for bin in swiftlyBinDirContents {
38+ let linkTarget = try ? await fs. readlink ( atPath: swiftlyBinDir / bin)
39+ if linkTarget == proxyTo {
40+ existingProxies. append ( bin)
41+ }
4142 }
4243
4344 for p in existingProxies {
You can’t perform that action at this time.
0 commit comments