protected function executeEngineCmdHook(CommandHookInterface $hook_command)
    {
        $options = $hook_command->getOptions();

        // Determine the service the command should be ran inside.
        $service = isset($options['service'])
            ? $options['service']
            : null;

        // Determine if the command should be ran locally.
        $localhost = (boolean) isset($options['localhost'])
            ? $options['localhost']
            : !isset($service);

        $command = $this->resolveHookCommand($hook_command);

        return $this->executeEngineCommand($command, $service, [], false, $localhost);
    }