Merge pull request #748 from arp242/pg_config

pgsql: Check for pg_config existence
This commit is contained in:
Shohei YOSHIDA 2020-06-03 14:23:50 +09:00 committed by GitHub
commit 3eea79e9e6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 4 deletions

View File

@ -147,10 +147,9 @@ _pgsql_databases () {
_pgsql_get_identity
local _pgsql_services _pgsql_service_files
_pgsql_service_files=(
~/.pg_service.conf
$(pg_config --sysconfdir)/pg_service.conf
)
_pgsql_service_files=(~/.pg_service.conf)
(( $+commands[pg_config] )) && _pgsql_service_files+=$(pg_config --sysconfdir)/pg_service.conf
_pgsql_services=$( grep -h '^\[.*\]' $_pgsql_service_files 2>/dev/null \
| sed -e 's/^\[/service=/' -e 's/\].*$//' )