Skip to content

Commit 2ca9344

Browse files
authored
Merge pull request #81 from glennsarti/add-puppet-agent-detection
Add better puppet-agent detection
2 parents 3fb8ffb + 3835679 commit 2ca9344

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

client/src/connection.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,13 @@ export class ConnectionManager implements IConnectionManager {
209209
break;
210210
default:
211211
myOutputChannel.appendLine('Starting language server')
212-
cmd = 'ruby'
212+
213+
// Try and find the puppet-agent ruby
214+
let rubyPath: string = '/opt/puppetlabs/puppet/bin/ruby';
215+
if (fs.existsSync(rubyPath)) { cmd = rubyPath }
216+
217+
// Default to ruby on the path
218+
if (cmd == undefined) { cmd = 'ruby' }
213219
options = {
214220
shell: true,
215221
env: process.env,

0 commit comments

Comments
 (0)