@@ -56,7 +56,11 @@ export class ArduinoSettings implements IArduinoSettings {
56
56
57
57
public get defaultExamplePath ( ) : string {
58
58
if ( os . platform ( ) === "darwin" ) {
59
- return path . join ( this . _arduinoPath , "Arduino.app/Contents/Java/examples" ) ;
59
+ if ( this . _arduinoPath . match ( / A r d u i n o .* \. a p p / ) ) {
60
+ return path . join ( this . _arduinoPath , "/Contents/Java/examples" ) ;
61
+ } else {
62
+ return path . join ( this . _arduinoPath , "Arduino.app/Contents/Java/examples" ) ;
63
+ }
60
64
} else {
61
65
return path . join ( this . _arduinoPath , "examples" ) ;
62
66
}
@@ -68,15 +72,23 @@ export class ArduinoSettings implements IArduinoSettings {
68
72
69
73
public get defaultPackagePath ( ) : string {
70
74
if ( os . platform ( ) === "darwin" ) {
71
- return path . join ( this . _arduinoPath , "Arduino.app/Contents/Java/hardware" ) ;
75
+ if ( this . _arduinoPath . match ( / A r d u i n o .* \. a p p / ) ) {
76
+ return path . join ( this . _arduinoPath , "/Contents/Java/hardware" ) ;
77
+ } else {
78
+ return path . join ( this . _arduinoPath , "Arduino.app/Contents/Java/hardware" ) ;
79
+ }
72
80
} else { // linux and win32.
73
81
return path . join ( this . _arduinoPath , "hardware" ) ;
74
82
}
75
83
}
76
84
77
85
public get defaultLibPath ( ) : string {
78
86
if ( os . platform ( ) === "darwin" ) {
79
- return path . join ( this . _arduinoPath , "Arduino.app/Contents/Java/libraries" ) ;
87
+ if ( this . _arduinoPath . match ( / A r d u i n o .* \. a p p / ) ) {
88
+ return path . join ( this . _arduinoPath , "/Contents/Java/libraries" ) ;
89
+ } else {
90
+ return path . join ( this . _arduinoPath , "Arduino.app/Contents/Java/libraries" ) ;
91
+ }
80
92
} else { // linux and win32
81
93
return path . join ( this . _arduinoPath , "libraries" ) ;
82
94
}
@@ -85,7 +97,11 @@ export class ArduinoSettings implements IArduinoSettings {
85
97
public get commandPath ( ) : string {
86
98
const platform = os . platform ( ) ;
87
99
if ( platform === "darwin" ) {
88
- return path . join ( this . _arduinoPath , path . normalize ( "Arduino.app/Contents/MacOS/Arduino" ) ) ;
100
+ if ( this . _arduinoPath . match ( / A r d u i n o .* \. a p p / ) ) {
101
+ return path . join ( this . _arduinoPath , path . normalize ( "/Contents/MacOS/Arduino" ) ) ;
102
+ } else {
103
+ return path . join ( this . _arduinoPath , path . normalize ( "Arduino.app/Contents/MacOS/Arduino" ) ) ;
104
+ }
89
105
} else if ( platform === "linux" ) {
90
106
return path . join ( this . _arduinoPath , "arduino" ) ;
91
107
} else if ( platform === "win32" ) {
0 commit comments