File tree 1 file changed +8
-6
lines changed
1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -151,25 +151,27 @@ func IsBundledInDesktopIDE() bool {
151
151
152
152
ideDir := filepath .Dir (executablePath )
153
153
154
- // We check an arbitrary number of folders that are part of the IDE
155
- // install tree
154
+ // To determine if the CLI is bundled with an IDE, We check an arbitrary
155
+ // number of folders that are part of the IDE install tree
156
156
tests := []string {
157
157
"tools-builder" ,
158
158
"examples/01.Basics/Blink" ,
159
- "portable" ,
160
159
}
161
160
162
161
for _ , test := range tests {
163
162
if _ , err := os .Stat (filepath .Join (ideDir , test )); err != nil {
164
163
// the test folder doesn't exist or is not accessible
165
164
return viper .GetBool ("IDE.Bundled" )
166
165
}
166
+ }
167
167
168
- if test == " portable" {
169
- viper . Set ( "IDE.Portable" , true )
170
- }
168
+ // Check whether this is a portable install
169
+ if _ , err := os . Stat ( filepath . Join ( ideDir , "portable" )); err != nil {
170
+ viper . Set ( "IDE.Portable" , true )
171
171
}
172
172
173
+ // Persist IDE-related config settings and return true
174
+ viper .Set ("IDE.Bundled" , false )
173
175
viper .Set ("IDE.Directory" , ideDir )
174
176
return true
175
177
}
You can’t perform that action at this time.
0 commit comments