Skip to content
Snippets Groups Projects
Commit 8080ca4c authored by Robert Goldmann's avatar Robert Goldmann
Browse files

bugfixes

parent 4ac79be7
Branches
Tags
No related merge requests found
No preview for this file type
No preview for this file type
......@@ -94,23 +94,23 @@ public class Main
}
}
password = "";
String destinationPassword = "";
if(!destinationPublic)
{
try
{
Console console = System.console();
password = new String(console.readPassword("Please enter the password for the destination repo: "));
destinationPassword = new String(console.readPassword("Please enter the password for the destination repo: "));
}
catch(NullPointerException e)
{
System.out.print("Please enter the password for the destination repo: ");
password = scanner.nextLine();
destinationPassword = scanner.nextLine();
}
}
GitHubClient destinationClient = new GitHubClient();
destinationClient.setCredentials(destinationUsername, password);
destinationClient.setCredentials(destinationUsername, destinationPassword);
System.out.println("");
System.out.println("_________________________________________________________________________________________________________________");
......@@ -156,15 +156,23 @@ public class Main
}
catch(IOException e)
{
e.printStackTrace();
System.err.println("An error occurred while inserting the labels into the destination repo!");
}
System.out.println("Successfully finished.");
}
catch(IOException e1)
{
if(e1.getMessage().contains("rate limit"))
{
System.err.println("You have reached the API-Limit for unauthorized requests. Try again later or authenticate with password.");
}
else
{
System.err.println("An error occurred while getting the labels from the source repo!\nCheck your credentials and make sure that you have access to the source repo (if it's not public)");
}
}
scanner.close();
}
......@@ -182,12 +190,12 @@ public class Main
{
try
{
System.out.println("Deleting " + i + "/" + existingLabels.size() + ": " + existingLabels.get(i).getName());
System.out.println("Deleting " + i+1 + "/" + existingLabels.size() + ": " + existingLabels.get(i).getName());
labelService.deleteLabel(client.getUser(), repoName, existingLabels.get(i).getName().replace(" ", "%20"));
}
catch(Exception e)
{
e.printStackTrace();
System.out.println("[ERROR] Label can't be deleted.");
}
}
System.out.println(">>> [Deleting finished]");
......@@ -205,8 +213,8 @@ public class Main
{
try
{
System.out.println("Inserting " + i + "/" + labels.size() + ": " + labels.get(i).getName());
labelService.createLabel(client.getUser(), "test", labels.get(i));
System.out.println("Inserting " + i+1 + "/" + labels.size() + ": " + labels.get(i).getName());
labelService.createLabel(client.getUser(), repoName, labels.get(i));
}
catch(RequestException e)
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment