Skip to content
This repository has been archived by the owner on Oct 25, 2023. It is now read-only.

Commit

Permalink
feat: install flatpak
Browse files Browse the repository at this point in the history
  • Loading branch information
MessiasLima committed May 4, 2021
1 parent 8447fce commit d003c73
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/app/service/setup/setup.service.ts
Expand Up @@ -12,7 +12,9 @@ export class SetupService {
}

installFlatpak(): Promise<string> {
return this.processService.executeCommand('pkexec apt install flatpak');
return this.processService.executeCommand(
'pkexec apt-get install flatpak -y && flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo',
);
}

checkIfSnapdIsInstalled(): Promise<string> {
Expand Down
8 changes: 6 additions & 2 deletions src/app/ui/pages/initial-setup/initial-setup.component.ts
Expand Up @@ -8,6 +8,7 @@ import { SetupService } from '../../../service/setup/setup.service';
styleUrls: ['./initial-setup.component.scss'],
})
export class InitialSetupComponent implements OnInit {
private wasFlatpakInstalled = false;
snapdStatus = CardStatus.NOT_INSTALLED;
flatpakStatus = CardStatus.NOT_INSTALLED;

Expand Down Expand Up @@ -64,10 +65,13 @@ export class InitialSetupComponent implements OnInit {
this.flatpakStatus = CardStatus.INSTALLING;
this.setupService
.installFlatpak()
.then(() => {
.then((result) => {
console.log(result);
this.flatpakStatus = CardStatus.INSTALLED;
this.wasFlatpakInstalled = true;
})
.catch(() => {
.catch((err) => {
console.error(err);
this.flatpakStatus = CardStatus.ERROR;
});
}
Expand Down

0 comments on commit d003c73

Please sign in to comment.