@@ -27,7 +27,9 @@ export function readBits(filepath) {
2727 * @returns {Ok | GError }
2828 */
2929export function writeBits ( filepath , contents ) {
30- return gleamResult ( ( ) => fs . writeFileSync ( path . normalize ( filepath ) , contents . buffer ) ) ;
30+ return gleamResult ( ( ) =>
31+ fs . writeFileSync ( path . normalize ( filepath ) , contents . rawBuffer ) ,
32+ ) ;
3133}
3234
3335/**
@@ -38,7 +40,9 @@ export function writeBits(filepath, contents) {
3840 * @returns {Ok | GError }
3941 */
4042export function appendBits ( filepath , contents ) {
41- return gleamResult ( ( ) => fs . appendFileSync ( path . normalize ( filepath ) , contents . buffer ) ) ;
43+ return gleamResult ( ( ) =>
44+ fs . appendFileSync ( path . normalize ( filepath ) , contents . rawBuffer ) ,
45+ ) ;
4246}
4347
4448/**
@@ -163,7 +167,9 @@ export function readDirectory(filepath) {
163167 * @returns {Ok | GError }
164168 */
165169export function copyFile ( srcpath , destpath ) {
166- return gleamResult ( ( ) => fs . copyFileSync ( path . normalize ( srcpath ) , path . normalize ( destpath ) ) ) ;
170+ return gleamResult ( ( ) =>
171+ fs . copyFileSync ( path . normalize ( srcpath ) , path . normalize ( destpath ) ) ,
172+ ) ;
167173}
168174
169175/**
@@ -174,7 +180,9 @@ export function copyFile(srcpath, destpath) {
174180 * @returns {Ok | GError }
175181 */
176182export function renameFile ( srcpath , destpath ) {
177- return gleamResult ( ( ) => fs . renameSync ( path . normalize ( srcpath ) , path . normalize ( destpath ) ) ) ;
183+ return gleamResult ( ( ) =>
184+ fs . renameSync ( path . normalize ( srcpath ) , path . normalize ( destpath ) ) ,
185+ ) ;
178186}
179187
180188/**
@@ -204,8 +212,8 @@ export function currentDirectory() {
204212 */
205213export function fileInfo ( filepath ) {
206214 return gleamResult ( ( ) => {
207- const stat = fs . statSync ( path . normalize ( filepath ) )
208- return new FileInfo ( stat )
215+ const stat = fs . statSync ( path . normalize ( filepath ) ) ;
216+ return new FileInfo ( stat ) ;
209217 } ) ;
210218}
211219
@@ -215,9 +223,9 @@ export function fileInfo(filepath) {
215223 */
216224export function linkInfo ( filepath ) {
217225 return gleamResult ( ( ) => {
218- const stat = fs . lstatSync ( path . normalize ( filepath ) )
219- return new FileInfo ( stat )
220- } )
226+ const stat = fs . lstatSync ( path . normalize ( filepath ) ) ;
227+ return new FileInfo ( stat ) ;
228+ } ) ;
221229}
222230
223231class FileInfo {
0 commit comments