Skip to content

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

Merged
gabrieldonadel merged 5 commits intomainfrom
@gabrieldonadel/linux-auto-update
Dec 3, 2024
Merged

[menu-bar][electron] Implement linux support for auto updater#229
gabrieldonadel merged 5 commits intomainfrom
@gabrieldonadel/linux-auto-update

Conversation

@gabrieldonadel
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
@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