mirror of
https://github.com/zed-industries/zed.git
synced 2024-12-24 17:28:40 +00:00
46 lines
911 B
Bash
Executable file
46 lines
911 B
Bash
Executable file
#!/usr/bin/env bash
|
|
|
|
# if not on Linux, do nothing
|
|
[[ $(uname) == "Linux" ]] || exit 0
|
|
|
|
# if sudo is not installed, define an empty alias
|
|
maysudo=$(command -v sudo || true)
|
|
export maysudo
|
|
|
|
# Ubuntu, Debian, etc.
|
|
# https://packages.ubuntu.com/
|
|
apt=$(command -v apt-get || true)
|
|
if [[ -n $apt ]]; then
|
|
deps=(
|
|
libasound2-dev
|
|
libfontconfig-dev
|
|
)
|
|
$maysudo "$apt" install -y "${deps[@]}"
|
|
exit 0
|
|
fi
|
|
|
|
# Fedora, CentOS, RHEL, etc.
|
|
# https://packages.fedoraproject.org/
|
|
dnf=$(command -v dnf || true)
|
|
if [[ -n $dnf ]]; then
|
|
deps=(
|
|
alsa-lib-devel
|
|
fontconfig-devel
|
|
)
|
|
$maysudo "$dnf" install -y "${deps[@]}"
|
|
exit 0
|
|
fi
|
|
|
|
# Arch, Manjaro, etc.
|
|
# https://archlinux.org/packages
|
|
pacman=$(command -v pacman || true)
|
|
if [[ -n $pacman ]]; then
|
|
deps=(
|
|
alsa-lib
|
|
fontconfig
|
|
)
|
|
$maysudo "$pacman" -S --noconfirm "${deps[@]}"
|
|
exit 0
|
|
fi
|
|
|
|
echo "Unsupported Linux distribution in script/linux"
|