mirror of
https://github.com/fleetdm/fleet
synced 2026-05-20 07:29:08 +00:00
#22473 - [X] Changes file added for user-visible changes in `changes/`, `orbit/changes/` or `ee/fleetd-chrome/changes`. See [Changes files](https://github.com/fleetdm/fleet/blob/main/docs/Contributing/Committing-Changes.md#changes-files) for more information. - [X] Added/updated tests - [X] Manual QA for all new/changed functionality - For Orbit and Fleet Desktop changes: - [x] Manual QA must be performed in the three main OSs, macOS, Windows and Linux. --------- Co-authored-by: RachelElysia <71795832+RachelElysia@users.noreply.github.com> Co-authored-by: Ian Littman <iansltx@gmail.com>
34 lines
957 B
TypeScript
34 lines
957 B
TypeScript
// @ts-ignore
|
|
import installPkg from "../../pkg/file/scripts/install_pkg.sh";
|
|
// @ts-ignore
|
|
import installMsi from "../../pkg/file/scripts/install_msi.ps1";
|
|
// @ts-ignore
|
|
import installExe from "../../pkg/file/scripts/install_exe.ps1";
|
|
// @ts-ignore
|
|
import installDeb from "../../pkg/file/scripts/install_deb.sh";
|
|
// @ts-ignore
|
|
import installRPM from "../../pkg/file/scripts/install_rpm.sh";
|
|
|
|
/*
|
|
* getInstallScript returns a string with a script to install the
|
|
* provided software.
|
|
* */
|
|
const getDefaultInstallScript = (fileName: string): string => {
|
|
const extension = fileName.split(".").pop();
|
|
switch (extension) {
|
|
case "pkg":
|
|
return installPkg;
|
|
case "msi":
|
|
return installMsi;
|
|
case "deb":
|
|
return installDeb;
|
|
case "rpm":
|
|
return installRPM;
|
|
case "exe":
|
|
return installExe;
|
|
default:
|
|
throw new Error(`unsupported file extension: ${extension}`);
|
|
}
|
|
};
|
|
|
|
export default getDefaultInstallScript;
|