Commit 338c849
committed
🤖 Fix symlink preservation when editing files in both runtimes
When editing a file through a symlink, both LocalRuntime and SSHRuntime
were replacing the symlink with a regular file instead of writing through
it to preserve the link.
SSHRuntime now uses 'cat temp > target' instead of 'mv temp target' to
write through symlinks. LocalRuntime resolves symlinks with fs.realpath()
before writing to the actual target.
Added integration test that verifies symlinks are preserved when editing
files through them in both local and SSH runtimes.1 parent ec66ae4 commit 338c849
File tree
3 files changed
+58
-4
lines changed- src/runtime
- tests/runtime
3 files changed
+58
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
241 | 241 | | |
242 | 242 | | |
243 | 243 | | |
| 244 | + | |
244 | 245 | | |
245 | 246 | | |
246 | 247 | | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
247 | 256 | | |
248 | | - | |
| 257 | + | |
249 | 258 | | |
250 | 259 | | |
251 | 260 | | |
252 | | - | |
| 261 | + | |
253 | 262 | | |
254 | 263 | | |
255 | 264 | | |
| |||
261 | 270 | | |
262 | 271 | | |
263 | 272 | | |
264 | | - | |
| 273 | + | |
265 | 274 | | |
266 | 275 | | |
267 | 276 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
263 | 263 | | |
264 | 264 | | |
265 | 265 | | |
| 266 | + | |
266 | 267 | | |
267 | 268 | | |
268 | 269 | | |
269 | 270 | | |
| 271 | + | |
270 | 272 | | |
271 | | - | |
| 273 | + | |
272 | 274 | | |
273 | 275 | | |
274 | 276 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
329 | 329 | | |
330 | 330 | | |
331 | 331 | | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
332 | 375 | | |
333 | 376 | | |
334 | 377 | | |
| |||
0 commit comments