From bf42f5ce856188b2e8ca60dfecedee2be54c6f8a Mon Sep 17 00:00:00 2001 From: Brian Zalewski Date: Wed, 4 Jan 2023 03:14:29 +0000 Subject: [PATCH] Update 2 files - /home/private_dot_config/shell/aliases.sh.tmpl - /home/dot_local/bin/executable_install-program --- home/dot_local/bin/executable_install-program | 8 +++++++- home/private_dot_config/shell/aliases.sh.tmpl | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/home/dot_local/bin/executable_install-program b/home/dot_local/bin/executable_install-program index e1a6bb50..68d41544 100644 --- a/home/dot_local/bin/executable_install-program +++ b/home/dot_local/bin/executable_install-program @@ -1021,7 +1021,13 @@ async function installPackageList(packageManager, packages) { } else if (packageManager === 'apt') { for (let pkg of packages) { try { - await $`sudo apt-get install -y ${pkg}` + try { + log('info', 'apt-get Installation', `Checking if ${pkg} is already installed`) + await $`dpkg -l ${pkg} | grep -E '^ii' > /dev/null` + } catch (e) { + log('info', 'apt-get Installation', `Installing ${pkg} since it is not already present on the system`) + await $`sudo apt-get install -y ${pkg}` + } } catch (e) { log('error', 'apt-get Failure', `There was an error installing ${pkg} with apt-get`) } diff --git a/home/private_dot_config/shell/aliases.sh.tmpl b/home/private_dot_config/shell/aliases.sh.tmpl index 38615442..a7a9e4d4 100644 --- a/home/private_dot_config/shell/aliases.sh.tmpl +++ b/home/private_dot_config/shell/aliases.sh.tmpl @@ -81,7 +81,7 @@ fi ### ripgrep if command -v rg &> /dev/null; then - alias grep='rg --color=auto' + alias rgrep='rg --color=auto' fi ### supdock