diff --git a/scripts/_common.sh b/scripts/_common.sh index 44f8924..88e95c0 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -143,14 +143,17 @@ myynh_install_homeassistant () { local legacy_args=u local -A args_array=( [p]=path= ) local path + # Manage arguments with getopts + ynh_handle_getopts_args "$@" + exec_as $app -H -s /bin/bash -c " \ echo 'create the virtual environment' \ && $MY_PYTHON -m venv "$final_path" \ && echo 'activate the virtual environment' \ && source "$final_path/bin/activate" \ && echo 'install last version of wheel' \ - && pip --cache-dir "$1/.cache" install --upgrade wheel \ + && pip --cache-dir "$path/.cache" install --upgrade wheel \ && echo 'install Home Assistant' \ - && pip --cache-dir "$1/.cache" install --upgrade $app==$VERSION \ + && pip --cache-dir "$path/.cache" install --upgrade $app==$VERSION \ " } diff --git a/scripts/install b/scripts/install index f11cc04..fc45bf4 100644 --- a/scripts/install +++ b/scripts/install @@ -48,6 +48,7 @@ chown $app: "$final_path" # create a directory for the datas of Home Assistant myynh_create_dir "$data_path/.$app" +myynh_create_dir "$data_path/.cache" chown -R $app: "$data_path" # build (if needed) & install Pyhton @@ -55,7 +56,7 @@ myynh_install_dependencies --python="$PY_REQUIRED_VERSION" # installation in a virtual environment ynh_script_progression --message="Installing Home Assistant in a virtual environment..." -myynh_install_homeassistant --path="$data_path" +ynh_exec_fully_quiet myynh_install_homeassistant --path="$data_path" # set default configuration files and move all homeassistant_conf_files ynh_script_progression --message="Configuring the installation..." diff --git a/scripts/upgrade b/scripts/upgrade index d0152bd..f1c759c 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -49,7 +49,7 @@ ynh_systemd_action --service_name="$app@$app" --action=stop --line_match="Stoppe # installation in a virtual environment ynh_script_progression --message="Installing Home Assistant in a virtual environment..." -myynh_install_homeassistant --path="$data_path" +ynh_exec_fully_quiet myynh_install_homeassistant --path="$data_path" # update script in bin ynh_script_progression --message="Updating YunoHost script used by homeassitant..."