Fix extensions installation on Windows (#1596)

* Fix extensions installation on Windows

Signed-off-by: Lauri Nevala <lauri.nevala@gmail.com>

* Get rid of readFileSync

Signed-off-by: Lauri Nevala <lauri.nevala@gmail.com>

* Add missing semicolon

Signed-off-by: Lauri Nevala <lauri.nevala@gmail.com>
This commit is contained in:
Lauri Nevala authored and GitHub committed 2020-12-02 09:08:44 +02:00
1 parent 06568fa232
commit 7b77f18376
2 files changed
+17 -8

No files matched your search

+4 -2
View File
@@ -15,7 +15,7 @@ export function readFileFromTar<R = Buffer>({ tarPath, filePath, parseJson }: Re
await tar.list({
file: tarPath,
filter: path => path === filePath,
filter: entryPath => path.normalize(entryPath) === filePath,
onentry(entry: FileStat) {
entry.on("data", chunk => {
fileChunks.push(chunk);
@@ -41,7 +41,9 @@ export async function listTarEntries(filePath: string): Promise<string[]> {
const entries: string[] = [];
await tar.list({
file: filePath,
onentry: (entry: FileStat) => entries.push(entry.path as any as string),
onentry: (entry: FileStat) => {
entries.push(path.normalize(entry.path as any as string));
},
});
return entries;
}