Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions packages/compass-smoke-tests/src/installers/linux-deb.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@ export function installLinuxDeb({
execute('sudo', ['apt', 'remove', '--yes', '--purge', packageName]);
}

console.warn(
"Installing globally, since we haven't discovered a way to specify an install path"
);

if (fs.existsSync(installPath)) {
console.warn(
'Found an existing install directory (likely from a previous run): Uninstalling first'
Expand All @@ -43,6 +39,9 @@ export function installLinuxDeb({
console.warn(
"Installing globally, since we haven't discovered a way to specify an install path"
);
// Update package index first to avoid fetching missing packages
execute('sudo', ['apt-get', 'update']);
// Using "apt" instead of "apt-get" to install dependencies
execute('sudo', ['apt', 'install', filepath]);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's okay for our case, but worth keeping in mind that apt man page specifically doesn't recommend usage in scripts 🙂

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah - I was considering using apt-get, but as far as I can tell, that won't install dependencies of the archive.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's fine, yeah, you can run multiple commands in sequence to basically do what apt does, but also we can make an argument that we're testing the exact flow our users will go through, so that would make using apt directly more appropriate 🙂


assert(
Expand Down