From da7d5cdd4e7494e52b6b960597e4ea7d8c94c20c Mon Sep 17 00:00:00 2001 From: Gaston Gonzalez Date: Fri, 28 Feb 2025 03:57:36 -0700 Subject: [PATCH] VARA Downloader - Added pup command for HTML procesing --- scripts/install-pup.sh | 39 +++++++++++++++++++++++++++++++++++++++ scripts/install.sh | 3 ++- 2 files changed, 41 insertions(+), 1 deletion(-) create mode 100755 scripts/install-pup.sh diff --git a/scripts/install-pup.sh b/scripts/install-pup.sh new file mode 100755 index 0000000..32a1352 --- /dev/null +++ b/scripts/install-pup.sh @@ -0,0 +1,39 @@ +#!/bin/bash +# Author : Gaston Gonzalez +# Date : 28 February 2025 +# Purpose : Install pup (HTML processing) + +VERSION="0.4.0" +ZIP_FILE="pup_v${VERSION}_linux_amd64.zip" +INSTALL_DIR="/opt/pup-${VERSION}" +INSTALL_DIR_BIN="${INSTALL_DIR}/bin" +LINK_PATH="/opt/pup" + +et-log "Installing pup (HTML processing tool)..." + +URL="https://github.com/ericchiang/pup/releases/download/v${VERSION}/${ZIP_FILE}" + +et-log "Downloading pup: ${URL}" +curl -s -f -L -o ${ZIP_FILE} ${URL} + +[[ $? -ne 0 ]] && et-log "Error fetching pup" && exit 1 + +mv -v ${ZIP_FILE} ${ET_DIST_DIR} + +CWD_DIR=$(pwd) + +if [[ ! -e "${INSTALL_DIR}" ]]; then + mkdir -v -p ${INSTALL_DIR_BIN} && cd ${INSTALL_DIR_BIN} + unzip ${ET_DIST_DIR}/${ZIP_FILE} +else + et-log "${INSTALL_DIR} already exists." +fi + +chmod 755 ${INSTALL_DIR_BIN}/pup + +[[ -e ${LINK_PATH} ]] && rm ${LINK_PATH} +ln -s ${INSTALL_DIR} ${LINK_PATH} + +stow -v -d /opt pup -t /usr/local + +cd ${CWD_DIR} diff --git a/scripts/install.sh b/scripts/install.sh index 11c2da8..ece608b 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -2,7 +2,7 @@ # # Author : Gaston Gonzalez # Date : 16 March 2024 -# Updated : 20 January 2025 +# Updated : 28 February 2025 # Purpose : Main installer for EmComm Tools OS Community . ./env.sh @@ -15,6 +15,7 @@ exitIfNotRoot ./install-base.sh ./install-dev-tools.sh +./install-pup.sh ./install-browser.sh ./remove-packages.sh ./install-branding.sh