Homogeneize command subtitutions in ynh_spawn_app_shell

This commit is contained in:
tituspijean 2023-05-30 11:18:54 +00:00
parent 1300585eda
commit db7ab2a98b
No known key found for this signature in database
GPG key ID: EF3B0D7CC0A94720

View file

@ -167,7 +167,7 @@ ynh_spawn_app_shell() {
[ -z "$service" ] && service=$app; [ -z "$service" ] && service=$app;
# Load the Environment variables from the app's service # Load the Environment variables from the app's service
local env_var=`systemctl show $service.service -p "Environment" --value` local env_var=$(systemctl show $service.service -p "Environment" --value)
[ -n "$env_var" ] && export $env_var; [ -n "$env_var" ] && export $env_var;
export HOME=$install_dir; export HOME=$install_dir;
@ -180,7 +180,7 @@ ynh_spawn_app_shell() {
fi fi
# Source the EnvironmentFiles from the app's service # Source the EnvironmentFiles from the app's service
local env_files=(`systemctl show $service.service -p "EnvironmentFiles" --value`) local env_files=($(systemctl show $service.service -p "EnvironmentFiles" --value))
if [ ${#env_files[*]} -gt 0 ] if [ ${#env_files[*]} -gt 0 ]
then then
# set -/+a enables and disables new variables being automatically exported. Needed when using `source`. # set -/+a enables and disables new variables being automatically exported. Needed when using `source`.