2022-02-06 12:20:36 +08:00
|
|
|
import { setupAptPack } from "../utils/setup/setupAptPack"
|
2022-06-30 00:06:35 +08:00
|
|
|
import { setupPacmanPack } from "../utils/setup/setupPacmanPack"
|
2022-02-06 12:20:36 +08:00
|
|
|
import { setupBrewPack } from "../utils/setup/setupBrewPack"
|
|
|
|
import { setupChocoPack } from "../utils/setup/setupChocoPack"
|
2022-06-30 10:06:33 +08:00
|
|
|
import { isArch } from "../utils/env/isArch"
|
2022-07-11 07:34:56 +08:00
|
|
|
import { hasDnf } from "../utils/env/hasDnf"
|
|
|
|
import { setupDnfPack } from "../utils/setup/setupDnfPack"
|
2022-07-11 08:39:21 +08:00
|
|
|
import { isUbuntu } from "../utils/env/isUbuntu"
|
2022-02-06 12:20:36 +08:00
|
|
|
|
|
|
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
|
|
export function setupSevenZip(version: string, _setupDir: string, _arch: string) {
|
|
|
|
switch (process.platform) {
|
|
|
|
case "win32": {
|
|
|
|
return setupChocoPack("7zip", version)
|
|
|
|
}
|
|
|
|
case "darwin": {
|
|
|
|
return setupBrewPack("p7zip", version)
|
|
|
|
}
|
|
|
|
case "linux": {
|
2022-06-30 10:06:33 +08:00
|
|
|
if (isArch()) {
|
2022-06-30 00:06:35 +08:00
|
|
|
return setupPacmanPack("p7zip", version)
|
2022-07-11 07:34:56 +08:00
|
|
|
} else if (hasDnf()) {
|
2022-07-11 09:02:43 +08:00
|
|
|
setupDnfPack("p7zip", version)
|
|
|
|
return setupDnfPack("p7zip-plugins", version)
|
2022-07-11 08:39:21 +08:00
|
|
|
} else if (isUbuntu()) {
|
2022-11-23 13:33:06 +08:00
|
|
|
return setupAptPack([{ name: "p7zip-full", version }])
|
2022-06-30 00:06:35 +08:00
|
|
|
}
|
2022-07-11 08:39:21 +08:00
|
|
|
throw new Error(`Unsupported linux distribution`)
|
2022-02-06 12:20:36 +08:00
|
|
|
}
|
|
|
|
default: {
|
|
|
|
throw new Error(`Unsupported platform`)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|