mirror of https://gitlab.com/nakst/essence
don't assume tar supports -a flag
This commit is contained in:
parent
b6e8b8f17f
commit
4ac89712e6
|
@ -52,7 +52,20 @@ void Get(str url, str directoryName, str checksum) {
|
||||||
PrintStdErr("Valid checksum.\n");
|
PrintStdErr("Valid checksum.\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
assert SystemShellExecute("tar -xaf %cachePath%");
|
str decompressFlag = "";
|
||||||
|
|
||||||
|
if StringContains(url, ".tar.bz2") {
|
||||||
|
decompressFlag = "j";
|
||||||
|
} else if StringContains(url, ".tar.xz") {
|
||||||
|
decompressFlag = "J";
|
||||||
|
} else if StringContains(url, ".tar.gz") {
|
||||||
|
decompressFlag = "z";
|
||||||
|
} else {
|
||||||
|
PrintStdErrWarning("Error: Unrecognised archive format extension.\n");
|
||||||
|
assert false;
|
||||||
|
}
|
||||||
|
|
||||||
|
assert SystemShellExecute("tar -x%decompressFlag%f %cachePath%");
|
||||||
assert PathMove(directoryName, "bin/source");
|
assert PathMove(directoryName, "bin/source");
|
||||||
|
|
||||||
PrintStdErr("File successfully downloaded and extracted.\n");
|
PrintStdErr("File successfully downloaded and extracted.\n");
|
||||||
|
|
Loading…
Reference in New Issue