joerg/LabViewGitEnv — pull request #4 by wireddown (2014-11-22 19:39:32+00:00)
Title: Fix testing for the presence of VIKit

Hi Jörg,

Thanks for merging my pull request :-)

Today I discovered a bug in my changes when I was helping a friend set up your tools. The bug only happens when VIKit is not installed.

Before my fix, this is what would happen:
```
$ git difftool path/to/some.vi
/usr/local/etc/LVDetect.sh: line 37: VIQueryVersion: command not found
ERROR: Unknown LabVIEW file version:
/usr/local/etc/LVDetect.sh: line 51: [: 2009: unary operator expected
/usr/local/etc/LVDetect.sh: line 51: [: 2010: unary operator expected
/usr/local/etc/LVDetect.sh: line 51: [: 2011: unary operator expected
/usr/local/etc/LVDetect.sh: line 51: [: 2012: unary operator expected
/usr/local/etc/LVDetect.sh: line 51: [: 2013: unary operator expected
/usr/local/etc/LVDetect.sh: line 51: [: 2014: unary operator expected
```

After my fix, this is what happens:
```
$ git difftool path/to/some.vi
INFO: I could detect the version of LabVIEW to use if VIKit were installed.
INFO: Using "C:\Program Files\National Instruments\LabVIEW 2009\LabVIEW.exe" by default
```

I'm sorry I didn't test more thoroughly before I made my first pull request :-\

Joe