Skip to content

Library debug #2948

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 9, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -97,16 +97,17 @@ public void updateIndex() throws Exception {
rescanLibraryIndex(progress);
}

public void install(ContributedLibrary lib, ContributedLibrary replacedLib) throws Exception {
public void install(ContributedLibrary lib, ContributedLibrary replacedLib) {
if (lib.isInstalled()) {
throw new Exception(_("Library is already installed!"));
System.out.println(_("Library is already installed: \"" + lib.getName() + "\""));
return;
}

final MultiStepProgress progress = new MultiStepProgress(3);

// Step 1: Download library
try {
downloader.download(lib, progress, _("Downloading library."));
downloader.download(lib, progress, _("Downloading library: \"" + lib.getName() + "\""));
} catch (InterruptedException e) {
// Download interrupted... just exit
return;
Expand All @@ -117,7 +118,7 @@ public void install(ContributedLibrary lib, ContributedLibrary replacedLib) thro
// all the temporary folders and abort installation.

// Step 2: Unpack library on the correct location
progress.setStatus(_("Installing library..."));
progress.setStatus(_("Installing library: \"" + lib.getName() + "\""));
onProgress(progress);
File libsFolder = indexer.getSketchbookLibrariesFolder();
File tmpFolder = FileUtils.createTempFolderIn(libsFolder);
Expand Down Expand Up @@ -148,7 +149,7 @@ public void remove(ContributedLibrary lib) throws IOException {
final MultiStepProgress progress = new MultiStepProgress(2);

// Step 1: Remove library
progress.setStatus(_("Removing library..."));
progress.setStatus(_("Removing library: \"" + lib.getName() + "\""));
onProgress(progress);
FileUtils.recursiveDelete(lib.getInstalledFolder());
progress.stepDone();
Expand Down