@@ -142,13 +142,13 @@ func IsBundledInDesktopIDE() bool {
142
142
executable , err := os .Executable ()
143
143
if err != nil {
144
144
feedback .Errorf ("Cannot get executable path: %v" , err )
145
- return viper . GetBool ( "IDE.Bundled" )
145
+ return false
146
146
}
147
147
148
148
executablePath , err := filepath .EvalSymlinks (executable )
149
149
if err != nil {
150
150
feedback .Errorf ("Cannot get executable path: %v" , err )
151
- return viper . GetBool ( "IDE.Bundled" )
151
+ return false
152
152
}
153
153
154
154
ideDir := filepath .Dir (executablePath )
@@ -163,17 +163,20 @@ func IsBundledInDesktopIDE() bool {
163
163
for _ , test := range tests {
164
164
if _ , err := os .Stat (filepath .Join (ideDir , test )); err != nil {
165
165
// the test folder doesn't exist or is not accessible
166
- return viper . GetBool ( "IDE.Bundled" )
166
+ return false
167
167
}
168
168
}
169
169
170
+ // the CLI is bundled in the Arduino IDE
171
+
172
+ // Persist IDE-related config settings
173
+ viper .Set ("IDE.Bundled" , true )
174
+ viper .Set ("IDE.Directory" , ideDir )
175
+
170
176
// Check whether this is a portable install
171
177
if _ , err := os .Stat (filepath .Join (ideDir , "portable" )); err != nil {
172
178
viper .Set ("IDE.Portable" , true )
173
179
}
174
180
175
- // Persist IDE-related config settings and return true
176
- viper .Set ("IDE.Bundled" , false )
177
- viper .Set ("IDE.Directory" , ideDir )
178
181
return true
179
182
}
0 commit comments