@@ -29,7 +29,6 @@ import (
29
29
"github.com/arduino/arduino-cli/arduino/utils"
30
30
paths "github.com/arduino/go-paths-helper"
31
31
"github.com/codeclysm/extract/v3"
32
- "github.com/sirupsen/logrus"
33
32
"gopkg.in/src-d/go-git.v4"
34
33
"gopkg.in/src-d/go-git.v4/plumbing"
35
34
)
@@ -175,19 +174,9 @@ func (lm *LibrariesManager) InstallZipLib(ctx context.Context, archivePath strin
175
174
if ! overwrite {
176
175
return fmt .Errorf (tr ("library %s already installed" ), libraryName )
177
176
}
178
- logrus .
179
- WithField ("library name" , libraryName ).
180
- WithField ("install path" , installPath ).
181
- Trace ("Deleting library" )
182
177
installPath .RemoveAll ()
183
178
}
184
179
185
- logrus .
186
- WithField ("library name" , libraryName ).
187
- WithField ("install path" , installPath ).
188
- WithField ("zip file" , archivePath ).
189
- Trace ("Installing library" )
190
-
191
180
// Copy extracted library in the destination directory
192
181
if err := extractionPath .CopyDirTo (installPath ); err != nil {
193
182
return fmt .Errorf (tr ("moving extracted archive to destination dir: %s" ), err )
@@ -205,9 +194,6 @@ func (lm *LibrariesManager) InstallGitLib(gitURL string, overwrite bool) error {
205
194
206
195
libraryName , ref , err := parseGitURL (gitURL )
207
196
if err != nil {
208
- logrus .
209
- WithError (err ).
210
- Warn ("Parsing git URL" )
211
197
return err
212
198
}
213
199
@@ -217,22 +203,12 @@ func (lm *LibrariesManager) InstallGitLib(gitURL string, overwrite bool) error {
217
203
if ! overwrite {
218
204
return fmt .Errorf (tr ("library %s already installed" ), libraryName )
219
205
}
220
- logrus .
221
- WithField ("library name" , libraryName ).
222
- WithField ("install path" , installPath ).
223
- Trace ("Deleting library" )
224
206
installPath .RemoveAll ()
225
207
}
226
208
if installPath .Exist () {
227
209
return fmt .Errorf (tr ("could not create directory %s: a file with the same name exists!" , installPath ))
228
210
}
229
211
230
- logrus .
231
- WithField ("library name" , libraryName ).
232
- WithField ("install path" , installPath ).
233
- WithField ("git url" , gitURL ).
234
- Trace ("Installing library" )
235
-
236
212
depth := 1
237
213
if ref != "" {
238
214
depth = 0
@@ -243,27 +219,15 @@ func (lm *LibrariesManager) InstallGitLib(gitURL string, overwrite bool) error {
243
219
Progress : os .Stdout ,
244
220
})
245
221
if err != nil {
246
- logrus .
247
- WithError (err ).
248
- Warn ("Cloning git repository" )
249
222
return err
250
223
}
251
224
252
225
if ref != "" {
253
226
if h , err := repo .ResolveRevision (ref ); err != nil {
254
- logrus .
255
- WithError (err ).
256
- Warnf ("Resolving revision %s" , ref )
257
227
return err
258
228
} else if w , err := repo .Worktree (); err != nil {
259
- logrus .
260
- WithError (err ).
261
- Warn ("Finding worktree" )
262
229
return err
263
230
} else if err := w .Checkout (& git.CheckoutOptions {Hash : plumbing .NewHash (h .String ())}); err != nil {
264
- logrus .
265
- WithError (err ).
266
- Warnf ("Checking out %s" , h )
267
231
return err
268
232
}
269
233
}
0 commit comments