Skip to content

Commit 6bbcf31

Browse files
Support .tar.xz
1 parent f400165 commit 6bbcf31

File tree

3 files changed

+15
-2
lines changed

3 files changed

+15
-2
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,5 @@ report.[0-9]_.[0-9]_.[0-9]_.[0-9]_.json
3333
# Finder (MacOS) folder config
3434
.DS_Store
3535

36-
build
36+
build
37+
.ck

lib/installers.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,13 @@ const extractArchive = (filePath, outputDir, extension) => {
171171
)}`
172172
);
173173
break;
174+
case "tar.xz":
175+
execSync(
176+
`tar -xJf ${JSON.stringify(filePath)} --directory ${JSON.stringify(
177+
outputDir
178+
)}`
179+
);
180+
break;
174181
case "zip":
175182
execSync(
176183
`unzip ${JSON.stringify(filePath)} -d ${JSON.stringify(outputDir)}`
@@ -202,7 +209,9 @@ const getBinaries = (dir) => {
202209
.toString()
203210
.split("\n")
204211
.filter(Boolean)
205-
.map((i) => i.replace(path.resolve(dir) + path.sep, ""));
212+
.map((i) => i.replace(path.resolve(dir) + path.sep, ""))
213+
// Filter out __MACOSX directories which contain only metadata
214+
.filter((i) => !i.includes("__MACOSX"));
206215
} catch {
207216
// Ignore find errors
208217
}

lib/sources.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -529,6 +529,9 @@ const getExtension = (filename) => {
529529
if (parts.length > 2 && parts.slice(-2).join(".") === "tar.gz") {
530530
return "tar.gz";
531531
}
532+
if (parts.length > 2 && parts.slice(-2).join(".") === "tar.xz") {
533+
return "tar.xz";
534+
}
532535
return parts.pop();
533536
};
534537

0 commit comments

Comments
 (0)