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

Add more freedom on Mac with different version of Arduino #375

Merged
merged 2 commits into from Jul 19, 2017

Conversation

@DeqingSun
Copy link
Contributor

commented Jul 18, 2017

On Mac Arduino app has to be called "Arduino.app". In some cases (include me) we add a version number to keep a bunch of Arduino due to compatibility issues.
This PR add a regex check when generating a path. If it already specify a Arduino app, no "Arduino.app" is added.

@msftclas

This comment has been minimized.

Copy link

commented Jul 18, 2017

@DeqingSun,
Thanks for your contribution.
To ensure that the project team has proper rights to use your work, please complete the Contribution License Agreement at https://cla.microsoft.com.

It will cover your contributions to all Microsoft-managed open source projects.
Thanks,
Microsoft Pull Request Bot

@msftclas

This comment has been minimized.

Copy link

commented Jul 18, 2017

@DeqingSun, thanks for signing the contribution license agreement. We will now validate the agreement and then the pull request.

Thanks, Microsoft Pull Request Bot

@@ -56,7 +56,11 @@ export class ArduinoSettings implements IArduinoSettings {

public get defaultExamplePath(): string {
if (os.platform() === "darwin") {
return path.join(this._arduinoPath, "Arduino.app/Contents/Java/examples");
if (this._arduinoPath.match(/Arduino.*\.app/)){

This comment has been minimized.

Copy link
@testforstephen

testforstephen Jul 18, 2017

Contributor

5 Duplicate if logics.
Suggest to add a utility method resolveMacArduinoAppPath in src/common/util.ts. Then just need join "/Contents/xxx"

resolveMacArduinoAppPath(arduinoPath: string): string {
if (/Arduino.*\.app/.test(arduinoPath)) {
return arduinoPath;
} else {
return path.join(arduinoPath, "Arduino.app");
}
}

@testforstephen

This comment has been minimized.

Copy link
Contributor

commented Jul 18, 2017

@DeqingSun Thanks for fixing the issue. Your PR doesn't pass tslint check. Please run "gulp tslint" in local PC first and fix the tslint issues.

@testforstephen testforstephen merged commit 405d5bd into microsoft:master Jul 19, 2017
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.