@componentor/fs 1.2.4 → 1.2.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -102,12 +102,15 @@ export class SymlinkManager {
102
102
 
103
103
  if (this.useSync) {
104
104
  const access = await fileHandle.createSyncAccessHandle()
105
- access.truncate(0)
106
- let written = 0
107
- while (written < buffer.length) {
108
- written += access.write(buffer.subarray(written), { at: written })
105
+ try {
106
+ access.truncate(0)
107
+ let written = 0
108
+ while (written < buffer.length) {
109
+ written += access.write(buffer.subarray(written), { at: written })
110
+ }
111
+ } finally {
112
+ access.close()
109
113
  }
110
- access.close()
111
114
  } else {
112
115
  const writable = await fileHandle.createWritable()
113
116
  await writable.write(buffer)