Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[menu-bar][electron] Implement linux support for auto updater #229

Merged
merged 5 commits into from
Dec 3, 2024

Conversation

gabrieldonadel
Copy link
Member

@gabrieldonadel gabrieldonadel commented Dec 3, 2024

Why

Expo Orbit 2.0 did not support auto update on linux yet

How

Implement a custom logic to support .deb and .rpm updates on linux

Test Plan

Run menu bar locally and update the version

Comment on lines 44 to 49
const installCommand =
fileExtension === '.deb'
? ['dpkg', '-i', this.lastUpdatePath]
: fileExtension === '.rpm'
? ['rpm', '-i', '--force', this.lastUpdatePath]
: null;
Copy link
Contributor

@alanjhughes alanjhughes Dec 3, 2024

Choose a reason for hiding this comment

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

It's kind of difficult to read. What do you think about moving this to a function? Something like this maybe

createInstallCommand(path: string) {
  switch (path) {
    case '.deb':
      return ['dpkg', '-i', this.lastUpdatePath];
    case '.rpm':
      return ['rpm', '-i', '--force', this.lastUpdatePath];
    default:
      throw new Error('Unsupported package format. Only .deb and .rpm are supported.');
  }
}

Copy link
Member Author

Choose a reason for hiding this comment

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

good call, updated

@gabrieldonadel gabrieldonadel merged commit eb738e8 into main Dec 3, 2024
1 check passed
@gabrieldonadel gabrieldonadel deleted the @gabrieldonadel/linux-auto-update branch December 3, 2024 18:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants