Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tbSystem uses command with --verbose argument even if command is ping #88

Open
hmqueener opened this issue Jul 16, 2018 · 1 comment
Open

Comments

@hmqueener
Copy link

Issue was identified on Windows 7, 64-bit
In my startup.m file I un-commented the lines that allow for checking internet:
checkInternetCommand = 'ping -n 1 www.google.com';
setpref('ToolboxToolbox', 'checkInternetCommand', checkInternetCommand)

Eventually the checkInternetCommand is used by tbSystem(), which parses out the 'ping' as a variable called executable
...
if ispc()
% For windows machine just check whether git exists
[status, result] = system([executable ' --version']);
...
I'm recommending that developers add a check for whether the command is git. When this command fails, tbSystem reports the command as failed.

@DavidBrainard
Copy link
Collaborator

I took a look at this. The problematic code was added by a Windows user out there in GitHub land, to get his system to work. It does the right thing in the special case where the command passed command is 'git' but as you note, not in other cases.

This code was there to get the full path to the executable, which we know how to do on Mac/Linux but not under Windows. I added a little more logic which for a PC checks as before if the command is git and otherwise just assumes that the command can be called as passed. This might fix your problem, but I am not set up to check since I don't have a PC.

Let me know whether it works for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants