Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Commit 802dd37

Browse files
committed
Address feedback
1 parent dac53d6 commit 802dd37

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

src/text-buffer.js

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1929,16 +1929,8 @@ class TextBuffer {
19291929
} catch (error) {
19301930
if (error.code !== 'EACCES' || destination !== filePath) throw error
19311931

1932-
const isMacOrLinux = process.platform === 'darwin' || process.platform === 'linux'
19331932
const isWindows = process.platform === 'win32'
1934-
if (isMacOrLinux) {
1935-
const fsAdmin = require('fs-admin')
1936-
try {
1937-
await this.buffer.save(fsAdmin.createWriteStream(filePath), this.getEncoding())
1938-
} catch (_) {
1939-
throw error
1940-
}
1941-
} else if (isWindows) {
1933+
if (isWindows) {
19421934
const winattr = getPromisifiedWinattr()
19431935
const attrs = await winattr.get(filePath)
19441936
if (!attrs.hidden) throw error
@@ -1950,6 +1942,13 @@ class TextBuffer {
19501942
} catch (_) {
19511943
throw error
19521944
}
1945+
} else {
1946+
const fsAdmin = require('fs-admin')
1947+
try {
1948+
await this.buffer.save(fsAdmin.createWriteStream(filePath), this.getEncoding())
1949+
} catch (_) {
1950+
throw error
1951+
}
19531952
}
19541953
}
19551954
} finally {

0 commit comments

Comments
 (0)