Commit c78080a
authored
Improve path management and filesystem operation ergonomics (#318)
Use FilePath instead of file URL's. FilePath is recommended
as the system data type to be used to represent local file paths
for command-line tools. The methods have simpler names while
retaining the same vital path arithmetic functions. It is much
less likely that a stringer will accidentally print out a file
URL to the user when a path is intended.
Remove usage of 'FileManager.default' in favour of API's that
are far less verbose to type and read. Make top-level API functions
for operations, such as checking if a file exists, removing files,
moving them, copying them, etc. Once SwiftlyCore is imported then
these functions become available for use. These functions accept
FilePath, not URL or String for a measure of type safety. Make the
new API's async by default to permit swapping FileManager with
another implementation that has async operations.
The most common file path operation is appending. Make use of
operator overloading to make these operations much cleaner, and
clearer with the division operator.
Disable tests on Ubuntu 20.04 and RedHat UBI9 Linux due to
crashes in the Swift runtime on those distributions.1 parent ee8a9c5 commit c78080a
File tree
32 files changed
+1082
-911
lines changed- .github/workflows
- Sources
- LinuxPlatform
- MacOSPlatform
- SwiftlyCore
- Swiftly
- TestSwiftly
- Tests/SwiftlyTests
32 files changed
+1082
-911
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | | - | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
41 | 43 | | |
42 | 44 | | |
43 | 45 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| 33 | + | |
33 | 34 | | |
34 | 35 | | |
35 | 36 | | |
| |||
42 | 43 | | |
43 | 44 | | |
44 | 45 | | |
| 46 | + | |
45 | 47 | | |
46 | 48 | | |
47 | 49 | | |
| |||
64 | 66 | | |
65 | 67 | | |
66 | 68 | | |
| 69 | + | |
67 | 70 | | |
68 | 71 | | |
69 | 72 | | |
| |||
123 | 126 | | |
124 | 127 | | |
125 | 128 | | |
| 129 | + | |
126 | 130 | | |
127 | 131 | | |
128 | 132 | | |
| |||
133 | 137 | | |
134 | 138 | | |
135 | 139 | | |
| 140 | + | |
136 | 141 | | |
137 | 142 | | |
138 | 143 | | |
| |||
145 | 150 | | |
146 | 151 | | |
147 | 152 | | |
148 | | - | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
149 | 157 | | |
150 | 158 | | |
151 | 159 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
| |||
44 | 45 | | |
45 | 46 | | |
46 | 47 | | |
47 | | - | |
| 48 | + | |
48 | 49 | | |
49 | 50 | | |
50 | 51 | | |
| |||
66 | 67 | | |
67 | 68 | | |
68 | 69 | | |
69 | | - | |
70 | | - | |
| 70 | + | |
| 71 | + | |
71 | 72 | | |
72 | 73 | | |
73 | 74 | | |
| |||
82 | 83 | | |
83 | 84 | | |
84 | 85 | | |
85 | | - | |
| 86 | + | |
86 | 87 | | |
87 | 88 | | |
88 | 89 | | |
| |||
0 commit comments