Skip to content

Commit

Permalink
Reformat Code
Browse files Browse the repository at this point in the history
  • Loading branch information
GameBuilder202 committed Feb 21, 2022
1 parent 925a036 commit edc51ed
Showing 1 changed file with 16 additions and 13 deletions.
29 changes: 16 additions & 13 deletions src/os/core/shell/Shell.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import java.io.*;

import java.lang.reflect.Field;

import java.util.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
Expand Down Expand Up @@ -408,13 +409,15 @@ else if (cmds.length == 2)
cdFolder = cdFolder.getFolder(path);
}

} catch (ArrayIndexOutOfBoundsException e)
}
catch (ArrayIndexOutOfBoundsException e)
{
this.printStream.print (ERR);
this.printStream.println("No folder name provided");
this.printStream.print (RESET);
break;
} catch (NullPointerException e)
}
catch (NullPointerException e)
{
noSuch("folder", cmds[1]);
break;
Expand Down Expand Up @@ -505,7 +508,7 @@ else if (cmds.length == 2)
}

case "info" -> this.printStream.print(
"""
"""
JavaOS version 0.2.4
Compiled with Java version 16
Expand Down Expand Up @@ -539,9 +542,9 @@ else if (cmds.length == 2)

if (this.rootFolder.getFolder("packages").getFolder(packageName) != null)
{
this.printStream.print(ERR);
this.printStream.print (ERR);
this.printStream.println("Package already installed, aborting installation");
this.printStream.print(RESET);
this.printStream.print (RESET);
break;
}

Expand Down Expand Up @@ -570,9 +573,9 @@ else if (cmds.length == 2)
String version = versionGiven ? packageInput[1] : (String) json.get("latest");
if (!versionMatcher.matcher(version).matches())
{
this.printStream.print(ERR);
this.printStream.print (ERR);
this.printStream.println("Invalid version as input, contact package owner if you did not provide version");
this.printStream.print(RESET);
this.printStream.print (RESET);
break;
}

Expand All @@ -582,9 +585,9 @@ else if (cmds.length == 2)

if (res.equals("404: Not Found"))
{
this.printStream.print(ERR);
this.printStream.print (ERR);
this.printStream.println("Version " + version + " of package " + packageName + " not found");
this.printStream.print(RESET);
this.printStream.print (RESET);
}

this.printStream.println("Parsing complete, installing...");
Expand Down Expand Up @@ -619,18 +622,18 @@ else if (cmds.length == 2)
}
catch (ParseException e)
{
this.printStream.print(ERR);
this.printStream.print (ERR);
this.printStream.println("Invalid package JSON, contact package owner about this issue");
this.printStream.print(RESET);
this.printStream.print (RESET);
}
}

case "remove" -> {
if (!this.rootFolder.getFolder("packages").removeFolder(cmds[2]))
{
this.printStream.print(ERR);
this.printStream.print (ERR);
this.printStream.println("Package not installed, nothing removed");
this.printStream.print(RESET);
this.printStream.print (RESET);
}
}

Expand Down

0 comments on commit edc51ed

Please sign in to comment.