From 82444de18db7f2a4daacc3bea8ae27d6477b02e5 Mon Sep 17 00:00:00 2001 From: goldyfruit Date: Fri, 25 Oct 2024 12:08:37 -0400 Subject: [PATCH 1/2] [installer] Make is POSIX compliant --- installer.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/installer.sh b/installer.sh index 1f48040f..0d9e71f5 100755 --- a/installer.sh +++ b/installer.sh @@ -1,24 +1,24 @@ -#!/bin/env bash +#!/bin/env sh # Set global variables based on sudo usage if [ -n "$SUDO_USER" ]; then export RUN_AS="$SUDO_USER" else - export RUN_AS=$USER + export RUN_AS="$USER" fi RUN_AS_HOME=$(eval echo ~"$RUN_AS") export RUN_AS_HOME # Check for git command to be installed -if ! command -v git &>/dev/null; then - echo -e "\n\e[31m[fail]\e[0m git command not found..." - echo -e " Please install git package before running the installer.\n" +if ! command -v gito >/dev/null 2>&1; then + printf "\n\e[31m[fail]\e[0m git command not found..." + printf "\n Please install git package before running the installer.\n\n" exit 1 fi # Remove ovos-installer directory if exists installer_path="$RUN_AS_HOME/ovos-installer" -if [[ -d "$installer_path" ]]; then +if [ -d "$installer_path" ]; then rm -rf "$installer_path" fi From 28cbb4b571eb2da0c3a7c8b53eaf8de65c64e0eb Mon Sep 17 00:00:00 2001 From: goldyfruit Date: Fri, 25 Oct 2024 12:13:58 -0400 Subject: [PATCH 2/2] [installer] Make is POSIX compliant --- installer.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/installer.sh b/installer.sh index 0d9e71f5..1784aaf9 100755 --- a/installer.sh +++ b/installer.sh @@ -10,7 +10,7 @@ RUN_AS_HOME=$(eval echo ~"$RUN_AS") export RUN_AS_HOME # Check for git command to be installed -if ! command -v gito >/dev/null 2>&1; then +if ! command -v git >/dev/null 2>&1; then printf "\n\e[31m[fail]\e[0m git command not found..." printf "\n Please install git package before running the installer.\n\n" exit 1