Browse Source

test if packages are already installed

Gildas 2 years ago
parent
commit
f0dd117447
1 changed files with 15 additions and 3 deletions
  1. 15 3
      build-extension.sh

+ 15 - 3
build-extension.sh

@@ -1,6 +1,18 @@
-#!/bin/sh
-
-sudo apt install zip jq
+#!/bin/bash
+
+dpkg -s zip &> /dev/null
+if [ $? -ne 0 ]
+then
+    echo "Installing zip"
+    sudo apt install zip
+fi
+
+dpkg -s jq &> /dev/null
+if [ $? -ne 0 ]
+then
+    echo "Installing jq"
+    sudo apt install jq
+fi
 
 npm install
 npm update