Skip to content

Commit 88c851b

Browse files
committed
Implement Linux tar installer
1 parent a96660c commit 88c851b

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

packages/compass-smoke-tests/src/installers/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { installMacDMG } from './mac-dmg';
33
import { installMacZIP } from './mac-zip';
44
import { installWindowsZIP } from './windows-zip';
55
import { installWindowsMSI } from './windows-msi';
6+
import { installLinuxTar } from './linux-tar';
67

78
export function getInstaller(kind: PackageKind) {
89
if (kind === 'osx_dmg') {
@@ -13,6 +14,8 @@ export function getInstaller(kind: PackageKind) {
1314
return installWindowsZIP;
1415
} else if (kind === 'windows_msi') {
1516
return installWindowsMSI;
17+
} else if (kind === 'linux_tar') {
18+
return installLinuxTar;
1619
} else {
1720
throw new Error(`Installer for '${kind}' is not yet implemented`);
1821
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import path from 'node:path';
2+
3+
import type { InstalledAppInfo, InstallablePackage } from './types';
4+
import { execute } from '../execute';
5+
6+
export function installLinuxTar({
7+
appName,
8+
filepath,
9+
destinationPath,
10+
}: InstallablePackage): InstalledAppInfo {
11+
const appFilename = `${appName}-linux-x64`;
12+
const appPath = path.resolve(destinationPath, appFilename);
13+
14+
execute('tar', ['-xzf', filepath, '-C', destinationPath]);
15+
16+
// Check that the executable will run without being quarantined or similar
17+
execute(path.resolve(appPath, appName), ['--version']);
18+
19+
return {
20+
appPath,
21+
uninstall: async function () {
22+
/* TODO */
23+
},
24+
};
25+
}

0 commit comments

Comments
 (0)