File tree Expand file tree Collapse file tree 2 files changed +8
-36
lines changed Expand file tree Collapse file tree 2 files changed +8
-36
lines changed Original file line number Diff line number Diff line change @@ -30,24 +30,9 @@ final class ObservableRestore {
30
30
presentrestorelist = true
31
31
}
32
32
33
- func verifypathforrestore( _ atpath: String ) -> Bool {
34
- do {
35
- let ok = try validatepath ( atpath)
36
- if ok {
37
- return true
38
- }
39
- return false
40
- } catch {
41
- return false
42
- }
43
- }
44
-
45
- private func validatepath( _ path: String ) throws -> Bool {
33
+ func verifypathforrestore( _ path: String ) -> Bool {
46
34
let fm = FileManager . default
47
- if fm. fileExists ( atPath: path, isDirectory: nil ) == false {
48
- throw Validatedpath . nopath
49
- }
50
- return true
35
+ return fm. fileExists ( atPath: path, isDirectory: nil )
51
36
}
52
37
53
38
func executerestore( ) {
Original file line number Diff line number Diff line change @@ -40,19 +40,13 @@ final class ObservableRsyncPathSetting {
40
40
return false
41
41
}
42
42
}
43
-
44
- func verifypathforrestore( _ atpath: String ) -> Bool {
45
- do {
46
- let ok = try validatepath ( atpath)
47
- if ok {
48
- return true
49
- }
50
- return false
51
- } catch {
52
- return false
53
- }
43
+
44
+ func verifypathforrestore( _ path: String ) -> Bool {
45
+ let fm = FileManager . default
46
+ return fm. fileExists ( atPath: path, isDirectory: nil )
54
47
}
55
48
49
+
56
50
// Only validate path if rsyncver3 is true
57
51
func setandvalidatepathforrsync( _ path: String ) -> Bool {
58
52
guard path. isEmpty == false , rsyncversion3 == true else {
@@ -72,14 +66,7 @@ final class ObservableRsyncPathSetting {
72
66
}
73
67
}
74
68
75
- private func validatepath( _ path: String ) throws -> Bool {
76
- let fm = FileManager . default
77
- if fm. fileExists ( atPath: path, isDirectory: nil ) == false {
78
- throw Validatedpath . nopath
79
- }
80
- return true
81
- }
82
-
69
+
83
70
private func verifystringtoint( _ seconds: String ) throws -> Bool {
84
71
guard seconds. isEmpty == false else { return false }
85
72
if Int ( seconds) != nil {
You can’t perform that action at this time.
0 commit comments