@@ -25,7 +25,6 @@ import (
25
25
"github.com/arduino/arduino-cli/i18n"
26
26
paths "github.com/arduino/go-paths-helper"
27
27
"github.com/arduino/go-win32-utils"
28
- "github.com/sirupsen/logrus"
29
28
"github.com/spf13/cobra"
30
29
jww "github.com/spf13/jwalterweatherman"
31
30
"github.com/spf13/viper"
@@ -132,61 +131,6 @@ func getDefaultUserDir() string {
132
131
}
133
132
}
134
133
135
- // IsBundledInDesktopIDE returns true if the CLI is bundled with the Arduino IDE.
136
- func IsBundledInDesktopIDE (settings * viper.Viper ) bool {
137
- // value is cached the first time we run the check
138
- if settings .IsSet ("IDE.Bundled" ) {
139
- return settings .GetBool ("IDE.Bundled" )
140
- }
141
-
142
- settings .Set ("IDE.Bundled" , false )
143
- settings .Set ("IDE.Portable" , false )
144
-
145
- logrus .Info ("Checking if CLI is Bundled into the IDE" )
146
- executable , err := os .Executable ()
147
- if err != nil {
148
- feedback .Errorf (tr ("Cannot get executable path: %v" ), err )
149
- return false
150
- }
151
-
152
- executablePath , err := filepath .EvalSymlinks (executable )
153
- if err != nil {
154
- feedback .Errorf (tr ("Cannot get executable path: %v" ), err )
155
- return false
156
- }
157
-
158
- ideDir := paths .New (executablePath ).Parent ()
159
- logrus .WithField ("dir" , ideDir ).Trace ("Candidate IDE directory" )
160
-
161
- // To determine if the CLI is bundled with an IDE, We check an arbitrary
162
- // number of folders that are part of the IDE install tree
163
- tests := []string {
164
- "tools-builder" ,
165
- "examples/01.Basics/Blink" ,
166
- }
167
-
168
- for _ , test := range tests {
169
- if ! ideDir .Join (test ).Exist () {
170
- // the test folder doesn't exist or is not accessible
171
- return false
172
- }
173
- }
174
-
175
- logrus .Info ("The CLI is bundled in the Arduino IDE" )
176
-
177
- // Persist IDE-related config settings
178
- settings .Set ("IDE.Bundled" , true )
179
- settings .Set ("IDE.Directory" , ideDir )
180
-
181
- // Check whether this is a portable install
182
- if ideDir .Join ("portable" ).Exist () {
183
- logrus .Info ("The IDE installation is 'portable'" )
184
- settings .Set ("IDE.Portable" , true )
185
- }
186
-
187
- return true
188
- }
189
-
190
134
// FindConfigFileInArgsOrWorkingDirectory returns the config file path using the
191
135
// argument '--config-file' (if specified) or looking in the current working dir
192
136
func FindConfigFileInArgsOrWorkingDirectory (args []string ) string {
0 commit comments