Update 00-global_var.sh

This commit is contained in:
Alexandre
2023-11-24 15:22:22 +01:00
committed by GitHub
parent 810da5370e
commit 61907fdf52

View File

@@ -41,7 +41,16 @@ for KEYS in "${arr[@]}"; do
######################################
# Export the variable to run scripts #
######################################
KEYS="${line%%=*}"
VALUE="${line#*=}"
line="${KEYS}='${VALUE}'"
export "$line"
# export to python
if command -v "python3" &>/dev/null; then
[ ! -f /env.py ] && echo "import os" > /env.py
echo "os.environ['${KEYS}'] = '${VALUE//[\"\']/}'" >> /env.py
python3 /env.py
fi
# set .env
echo "$line" >> /.env || true
# set /etc/environment