ENH update install script

This commit is contained in:
Nathan Dwarshuis 2022-06-29 20:51:39 -04:00
parent 02a1069d3c
commit 4cea560dae
1 changed files with 13 additions and 12 deletions

View File

@ -2,17 +2,18 @@
## Install all dependencies for emacs to run at full capacity ## Install all dependencies for emacs to run at full capacity
if emacs -batch -l "init.el"; then EMACS_PKG=emacs-nativecomp
IFS=' ' read -r -a emacs_pkgs \
< <(emacs -batch -l "init.el" --eval \ if ! command -v emacs > /dev/null; then
'(print (format "pkgs: %s" (s-join " " (nd/get-dependencies (list :pacman :aur)))))' \ if sudo pacman -S "$EMACS_PKG"; then
2>/dev/null | \ echo "Could not install emacs. Exiting"
sed -n -e 's/"pkgs: \(.*\)"/\1/p') exit 1
echo "Emacs requires the following system pkgs: ${emacs_pkgs[*]}" fi
else
echo "Could not get list of emacs dependencies."
emacs_pkgs=()
fi fi
MAKEFLAGS="-j$(nproc)" \ if command -v yay > /dev/null; then
yay --needed --noconfirm --norebuild --removemake -S "${emacs_pkgs[@]}" emacs -batch -l init.el -f nd/install-arch-dependencies
else
echo "Yay not installed. Exiting"
exit 1
fi