1
0
mirror of https://github.com/arduino/Arduino.git synced 2024-12-01 12:24:14 +01:00

Command line: added more verbosity and made output coherent

This commit is contained in:
Cristian Maglie 2018-01-22 15:04:43 +01:00
parent 8d27171b74
commit 3bce82092e
2 changed files with 6 additions and 3 deletions

View File

@ -360,6 +360,9 @@ public class Base {
Optional<ContributedLibrary> mayInstalled = indexer.getIndex().getInstalled(libraryToInstallParts[0]); Optional<ContributedLibrary> mayInstalled = indexer.getIndex().getInstalled(libraryToInstallParts[0]);
if (mayInstalled.isPresent() && selected.isIDEBuiltIn()) { if (mayInstalled.isPresent() && selected.isIDEBuiltIn()) {
System.out.println(tr(I18n
.format("Library {0} is available as built-in in the IDE.\nRemoving the other version {1} installed in the sketchbook...",
library, mayInstalled.get().getParsedVersion())));
libraryInstaller.remove(mayInstalled.get(), progressListener); libraryInstaller.remove(mayInstalled.get(), progressListener);
} else { } else {
libraryInstaller.install(selected, mayInstalled, progressListener); libraryInstaller.install(selected, mayInstalled, progressListener);

View File

@ -85,7 +85,7 @@ public class LibraryInstaller {
public synchronized void install(ContributedLibrary lib, Optional<ContributedLibrary> mayReplacedLib, ProgressListener progressListener) throws Exception { public synchronized void install(ContributedLibrary lib, Optional<ContributedLibrary> mayReplacedLib, ProgressListener progressListener) throws Exception {
if (lib.isLibraryInstalled()) { if (lib.isLibraryInstalled()) {
System.out.println(I18n.format(tr("Library is already installed: {0} version {1}"), lib.getName(), lib.getParsedVersion())); System.out.println(I18n.format(tr("Library is already installed: {0}:{1}"), lib.getName(), lib.getParsedVersion()));
return; return;
} }
@ -106,7 +106,7 @@ public class LibraryInstaller {
// all the temporary folders and abort installation. // all the temporary folders and abort installation.
// Step 2: Unpack library on the correct location // Step 2: Unpack library on the correct location
progress.setStatus(I18n.format(tr("Installing library: {0}"), lib.getName())); progress.setStatus(I18n.format(tr("Installing library: {0}:{1}"), lib.getName(), lib.getParsedVersion()));
progressListener.onProgress(progress); progressListener.onProgress(progress);
File libsFolder = BaseNoGui.getSketchbookLibrariesFolder().folder; File libsFolder = BaseNoGui.getSketchbookLibrariesFolder().folder;
File tmpFolder = FileUtils.createTempFolder(libsFolder); File tmpFolder = FileUtils.createTempFolder(libsFolder);
@ -139,7 +139,7 @@ public class LibraryInstaller {
final MultiStepProgress progress = new MultiStepProgress(2); final MultiStepProgress progress = new MultiStepProgress(2);
// Step 1: Remove library // Step 1: Remove library
progress.setStatus(I18n.format(tr("Removing library: {0}"), lib.getName())); progress.setStatus(I18n.format(tr("Removing library: {0}:{1}"), lib.getName(), lib.getParsedVersion()));
progressListener.onProgress(progress); progressListener.onProgress(progress);
FileUtils.recursiveDelete(lib.getInstalledLibrary().get().getInstalledFolder()); FileUtils.recursiveDelete(lib.getInstalledLibrary().get().getInstalledFolder());
progress.stepDone(); progress.stepDone();