From 0975168f35fc098fbd01f080dd5d2a1e8bb18953 Mon Sep 17 00:00:00 2001 From: Thomas Forgione Date: Wed, 26 Sep 2018 18:30:54 +0200 Subject: [PATCH] Install libssl-dev if not --- zsh/update.zsh | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/zsh/update.zsh b/zsh/update.zsh index 03cc5f9..922e7e2 100644 --- a/zsh/update.zsh +++ b/zsh/update.zsh @@ -48,7 +48,7 @@ update() { # Fedora based systems command -v dnf > /dev/null 2>&1 if [ $? -eq 0 ]; then - dnf upgrade + sudo dnf upgrade fi # Update rust if installed @@ -63,6 +63,24 @@ update() { cargo install-update --help > /dev/null 2>&1 if [ $? -ne 0 ]; then + + pkg-config --libs --cflags openssl > /dev/null 2>&1 + if [ $? -ne 0 ]; then + + # We need to install openssl + command -v apt > /dev/null 2>&1 + if [ $? -eq 0 ]; then + sudo apt install -y libssl-dev + fi + + # For fedora + command -v dnf > /dev/null 2>&1 + if [ $? -eq 0 ]; then + sudo dnf install openssl-devel + fi + + fi + echo "\033[32;1m=== Installing rust packages updater ===\033[0m" cargo install cargo-update fi