[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
This commit is contained in:
		
							parent
							
								
									b8e9cd478a
								
							
						
					
					
						commit
						a2559e47d5
					
				@ -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
 | 
			
		||||
 | 
			
		||||
@ -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
 | 
			
		||||
 | 
			
		||||
@ -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
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user