Add binary extraction
I temporarily removed this during the refactor so it needed to be added back. This time I bundled it with the nbin loader code since it's all related (will also make it easier to remove).
This commit is contained in:
@ -151,19 +151,6 @@ export const open = async (url: string): Promise<void> => {
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Extract a file to the temporary directory and make it executable. This is
|
||||
* required since we can't execute binaries stored within our binary.
|
||||
*/
|
||||
export const unpackExecutables = async (filePath: string): Promise<void> => {
|
||||
const destination = path.join(tmpdir, "binaries", path.basename(filePath))
|
||||
if (filePath && !(await util.promisify(fs.exists)(destination))) {
|
||||
await fs.mkdirp(tmpdir)
|
||||
await fs.writeFile(destination, await fs.readFile(filePath))
|
||||
await util.promisify(fs.chmod)(destination, "755")
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* For iterating over an enum's values.
|
||||
*/
|
||||
|
Reference in New Issue
Block a user