-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path21_linux_flatpak.sh
More file actions
26 lines (23 loc) · 841 Bytes
/
Copy path21_linux_flatpak.sh
File metadata and controls
26 lines (23 loc) · 841 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# Install Flatpak and add Flathub (Linux desktop only). Skip on macOS and WSL.
is_macos && return 0
is_wsl && return 0
[[ "$CI" ]] && return 0
# Install flatpak if not available.
if [[ ! "$(type -P flatpak)" ]]; then
if is_ubuntu; then
e_header "Installing Flatpak"
sudo apt-get install -qq -y flatpak
elif is_rhel; then
e_header "Installing Flatpak"
sudo yum install -y flatpak
else
e_error "Flatpak not found and no known install method for this OS."
return 1
fi
fi
[[ ! "$(type -P flatpak)" ]] && e_error "Flatpak failed to install." && return 1
# Add Flathub repo if not already configured.
if ! flatpak remotes --columns=name 2>/dev/null | grep -q '^flathub$'; then
e_header "Adding Flathub repository"
flatpak remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo
fi