This repository was archived by the owner on Dec 15, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +8
-9
lines changed Expand file tree Collapse file tree 1 file changed +8
-9
lines changed Original file line number Diff line number Diff 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 {
You can’t perform that action at this time.
0 commit comments