Skip to content

Commit

Permalink
Merge pull request #192 from OpenVoiceOS/fix/bash_vs_dash
Browse files Browse the repository at this point in the history
[installer] POSIX compliant
  • Loading branch information
goldyfruit authored Oct 25, 2024
2 parents ff1ed1e + 28cbb4b commit d6ba038
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions installer.sh
Original file line number Diff line number Diff line change
@@ -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 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
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

Expand Down

0 comments on commit d6ba038

Please sign in to comment.