1
0

install updates

This commit is contained in:
2024-11-30 23:59:51 +01:00
parent 048cc661b4
commit e82da26143
2 changed files with 49 additions and 2 deletions
+11 -2
View File
@@ -1,13 +1,22 @@
#!/bin/bash
# This script adds the bin directory to PATH
# This script adds the bin directory to PATH and loads environment variables from .env
#
# Usage:
# Source this script in your rc:
# source /path/to/here/install.sh
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
SCRIPT_DIR="$(dirname "$(realpath "$0")")"
BIN_DIR="$SCRIPT_DIR/bin"
ENV_FILE="$SCRIPT_DIR/.env"
if [ -d "$BIN_DIR" ] && [[ ":$PATH:" != *":$BIN_DIR:"* ]]; then
export PATH="$PATH:$BIN_DIR"
fi
if [ -f "$ENV_FILE" ]; then
while IFS='=' read -r key value; do
if [ -n "$key" ] && [ -n "$value" ] && [[ ! "$key" =~ ^# ]]; then
export "$key=$value"
fi
done < "$ENV_FILE"
fi