Skip to content

Commit

Permalink
Fix PATH handling
Browse files Browse the repository at this point in the history
  • Loading branch information
msakrejda committed May 23, 2020
1 parent 7cf32f1 commit 9f3b69e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ async function execPsql(url: string, query: string): Promise<string> {
let result = ''
debug('Running query: %s', query.trim())
const psql = spawn('psql', ['-c', query, '--set', 'sslmode=require', url], {
env: {PGAPPNAME: 'psql non-interactive'},
env: {PGAPPNAME: 'psql non-interactive', PATH: process.env.PATH},
encoding: 'utf8',
stdio: ['ignore', 'pipe', 'inherit'],
})
Expand All @@ -81,7 +81,7 @@ async function execPsqlWithFile(url: string, file: string): Promise<string> {
let result = ''
debug('Running sql file: %s', file.trim())
const psql = spawn('psql', ['-f', file, '--set', 'sslmode=require', url], {
env: {PGAPPNAME: 'psql non-interactive'},
env: {PGAPPNAME: 'psql non-interactive', PATH: process.env.PATH},
encoding: 'utf8',
stdio: ['ignore', 'pipe', 'inherit'],
})
Expand Down Expand Up @@ -117,7 +117,7 @@ async function psqlInteractive(url: string, prompt: string): Promise<void> {
psqlArgs = psqlArgs.concat(['--set', 'sslmode=require', url])

const psql = spawn('psql', psqlArgs, {
env: {PGAPPNAME: 'psql interactive'},
env: {PGAPPNAME: 'psql interactive', PATH: process.env.PATH},
stdio: 'inherit',
})
handlePsqlError(reject, psql)
Expand Down

0 comments on commit 9f3b69e

Please sign in to comment.