This repository was archived by the owner on May 23, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ export class Binary implements nbin.Binary {
15
15
16
16
public constructor ( private readonly options : nbin . BinaryOptions ) { }
17
17
18
- public writeFile ( pathName : string , content : Buffer ) : void {
18
+ public writeFile ( pathName : string , content : Buffer | string ) : void {
19
19
const parts = path
20
20
. normalize ( pathName )
21
21
. split ( path . sep )
@@ -24,7 +24,7 @@ export class Binary implements nbin.Binary {
24
24
for ( let i = 0 ; i < parts . length ; i ++ ) {
25
25
const part = parts [ i ]
26
26
if ( i === parts . length - 1 ) {
27
- writableFs . write ( part , content )
27
+ writableFs . write ( part , typeof content === "string" ? Buffer . from ( content ) : content )
28
28
} else {
29
29
writableFs = writableFs . cd ( part )
30
30
}
@@ -128,7 +128,7 @@ export class Binary implements nbin.Binary {
128
128
}
129
129
130
130
private async cacheBinary ( ) : Promise < Buffer > {
131
- let nodeBinaryPath = this . options . nodePath || path . join ( __dirname , "../../lib/node/out/Release/ node" )
131
+ let nodeBinaryPath = this . options . nodePath || path . join ( __dirname , "../../lib/node/node" )
132
132
const nodeBinaryName = this . nodeBinaryName
133
133
134
134
// By default we use the locally compiled node. If that or the provided Node
You can’t perform that action at this time.
0 commit comments