From a2559e47d5bca392652f121ec24abb4348551def Mon Sep 17 00:00:00 2001 From: Simon Lejeune Date: Fri, 18 Nov 2016 15:18:15 +0100 Subject: [PATCH] [FIX] Odoo 8.0-10.0: handling of odoo subcommand When using an Odoo subcommand, the name of this subcommand has to be in first position in the arguments list. Just pass the postgres config at the end of the command... except for the scaffold one. Fixes #83 --- 10.0/entrypoint.sh | 22 +++++++++++++--------- 8.0/entrypoint.sh | 22 +++++++++++++--------- 9.0/entrypoint.sh | 22 +++++++++++++--------- 3 files changed, 39 insertions(+), 27 deletions(-) diff --git a/10.0/entrypoint.sh b/10.0/entrypoint.sh index 576a165..4f0ef59 100755 --- a/10.0/entrypoint.sh +++ b/10.0/entrypoint.sh @@ -24,15 +24,19 @@ check_config "db_user" "$USER" check_config "db_password" "$PASSWORD" case "$1" in - -- | odoo) - shift - exec odoo "${DB_ARGS[@]}" "$@" - ;; - -*) - exec odoo "${DB_ARGS[@]}" "$@" - ;; - *) - exec "$@" + -- | odoo) + shift + if [[ "$1" == "scaffold" ]] ; then + exec odoo "$@" + else + exec odoo "$@" "${DB_ARGS[@]}" + fi + ;; + -*) + exec odoo "$@" "${DB_ARGS[@]}" + ;; + *) + exec "$@" esac exit 1 diff --git a/8.0/entrypoint.sh b/8.0/entrypoint.sh index 3e1ab0f..a958c3c 100755 --- a/8.0/entrypoint.sh +++ b/8.0/entrypoint.sh @@ -24,15 +24,19 @@ check_config "db_user" "$USER" check_config "db_password" "$PASSWORD" case "$1" in - -- | openerp-server) - shift - exec openerp-server "${DB_ARGS[@]}" "$@" - ;; - -*) - exec openerp-server "${DB_ARGS[@]}" "$@" - ;; - *) - exec "$@" + -- | openerp-server) + shift + if [[ "$1" == "scaffold" ]] ; then + exec openerp-server "$@" + else + exec openerp-server "$@" "${DB_ARGS[@]}" + fi + ;; + -*) + exec openerp-server "$@" "${DB_ARGS[@]}" + ;; + *) + exec "$@" esac exit 1 diff --git a/9.0/entrypoint.sh b/9.0/entrypoint.sh index 3e1ab0f..a958c3c 100755 --- a/9.0/entrypoint.sh +++ b/9.0/entrypoint.sh @@ -24,15 +24,19 @@ check_config "db_user" "$USER" check_config "db_password" "$PASSWORD" case "$1" in - -- | openerp-server) - shift - exec openerp-server "${DB_ARGS[@]}" "$@" - ;; - -*) - exec openerp-server "${DB_ARGS[@]}" "$@" - ;; - *) - exec "$@" + -- | openerp-server) + shift + if [[ "$1" == "scaffold" ]] ; then + exec openerp-server "$@" + else + exec openerp-server "$@" "${DB_ARGS[@]}" + fi + ;; + -*) + exec openerp-server "$@" "${DB_ARGS[@]}" + ;; + *) + exec "$@" esac exit 1