Skip to content

Commit e6393a1

Browse files
committed
Allow g:arduino_dir to be manually specified
1 parent 4a50f26 commit e6393a1

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

Diff for: autoload/arduino.vim

+6
Original file line numberDiff line numberDiff line change
@@ -391,8 +391,14 @@ function! s:CacheLine(lines, varname)
391391
endfunction
392392

393393
function! arduino#GetArduinoDir()
394+
if exists('g:arduino_dir')
395+
return g:arduino_dir
396+
endif
394397
let arduino_cmd = arduino#FindExecutable('arduino')
395398
let arduino_dir = fnamemodify(arduino_cmd, ':h')
399+
if !s:FileExists(arduino_dir . '/hardware/arduino/')
400+
throw "Could not find arduino directory. Please set g:arduino_dir"
401+
endif
396402
return arduino_dir
397403
endfunction
398404

Diff for: doc/arduino.txt

+5
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,11 @@ The path to the 'arduino' command. By default it will use the
4040
'arduino-headless' script in the 'bin' directory, which looks for 'arduino' in
4141
your PATH and runs it inside Xvfb if it can. >
4242
let g:arduino_cmd = '/usr/share/local/arduino/arduino'
43+
<
44+
*'g:arduino_dir'*
45+
The path to your 'arduino' directory. Usually vim-arduino will be able to
46+
detect it, but if it cannot you can set the value manually.
47+
let g:arduino_dir = '/usr/share/local/arduino'
4348
<
4449
*'g:arduino_args'*
4550
Additional arguments that will be passed to the 'arduino' command during build

Diff for: doc/tags

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
'g:arduino_auto_baud' arduino.txt /*'g:arduino_auto_baud'*
33
'g:arduino_board' arduino.txt /*'g:arduino_board'*
44
'g:arduino_cmd' arduino.txt /*'g:arduino_cmd'*
5+
'g:arduino_dir' arduino.txt /*'g:arduino_dir'*
56
'g:arduino_programmer' arduino.txt /*'g:arduino_programmer'*
67
'g:arduino_serial_baud' arduino.txt /*'g:arduino_serial_baud'*
78
'g:arduino_serial_cmd' arduino.txt /*'g:arduino_serial_cmd'*

0 commit comments

Comments
 (0)