Skip to content

Commit 9e54e12

Browse files
Merge pull request #11 from SrijanBatra/dev
Installation fixes
2 parents a705827 + b459237 commit 9e54e12

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

setup.sh

100755100644
Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,15 @@
44
# ----------------------------
55
# This script installs, uninstalls, backs up, restores App, and includes load testing using Locust.
66

7-
USER_NAME=$(logname)
7+
USER_NAME=$USER
8+
echo $USER_NAME
9+
echo $HOME
10+
if [ "$(whoami)" = "root" ]; then
11+
USER_NAME=$(cat /etc/passwd | grep '/home' | cut -d: -f1 | tail -n 1)
12+
else
13+
USER_NAME=$(whoami)
14+
fi
15+
echo $USER_NAME
816
USER_HOME=/home/$USER_NAME
917

1018
# Define directories and file paths
@@ -874,8 +882,8 @@ update_dependencies() {
874882

875883
log "INFO" "Installing dependencies from $REQUIREMENTS_FILE..."
876884

877-
# Install dependencies silently
878-
sudo -u "$SUDO_USER" bash -c "source $CONDA_SETUP_SCRIPT && conda activate $CONDA_ENV_NAME && pip install -r $EXTRACT_DIR/$APP_NAME-*/$REQUIREMENTS_FILE" > /dev/null 2>&1 || {
885+
# Install dependencies
886+
sudo -u "$SUDO_USER" bash -c "source $CONDA_SETUP_SCRIPT && conda activate $CONDA_ENV_NAME && pip install -r $EXTRACT_DIR/$APP_NAME-*/$REQUIREMENTS_FILE" || {
879887
log "ERROR" "Failed to install dependencies from $REQUIREMENTS_FILE."
880888
exit 1
881889
}
@@ -1050,3 +1058,4 @@ case $ACTION in
10501058
fetch_github_releases) fetch_github_releases ;;
10511059
*) echo "No action specified. Use --help for usage information." ;;
10521060
esac
1061+

0 commit comments

Comments
 (0)