Skip to content

Commit

Permalink
Update Graql (new string escaping behaviour) (#4987)
Browse files Browse the repository at this point in the history
  • Loading branch information
haikalpribadi authored Feb 27, 2019
1 parent 1eb56b0 commit bb88586
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions ConsoleSession.java
Original file line number Diff line number Diff line change
Expand Up @@ -119,39 +119,39 @@ void run() throws IOException, InterruptedException {
consoleReader.print(COPYRIGHT);

tx = session.transaction().write();
String queryString;
String input;

while ((queryString = consoleReader.readLine()) != null) {
if (queryString.equals(EDITOR)) {
while ((input = consoleReader.readLine()) != null) {
if (input.equals(EDITOR)) {
executeQuery(openTextEditor());

} else if (queryString.startsWith(LOAD + ' ')) {
} else if (input.startsWith(LOAD + ' ')) {
try{
queryString = readFile(Paths.get(unescapeJava(queryString.substring(LOAD.length() + 1))));
executeQuery(queryString);
input = readFile(Paths.get(unescapeJava(input.substring(LOAD.length() + 1))));
executeQuery(input);
} catch (NoSuchFileException e) {
System.err.println("File not found: " + e.getMessage());
}
} else if (queryString.equals(COMMIT)) {
} else if (input.equals(COMMIT)) {
commit();

} else if (queryString.equals(ROLLBACK)) {
} else if (input.equals(ROLLBACK)) {
rollback();

} else if (queryString.equals(CLEAN)) {
} else if (input.equals(CLEAN)) {
clean();
consoleReader.flush();
return;

} else if (queryString.equals(CLEAR)) {
} else if (input.equals(CLEAR)) {
consoleReader.clearScreen();

} else if (queryString.equals(EXIT)) {
} else if (input.equals(EXIT)) {
consoleReader.flush();
return;

} else if (!queryString.isEmpty()) {
executeQuery(queryString);
} else if (!input.isEmpty()) {
executeQuery(input);

} // We ignore empty commands
}
Expand Down

0 comments on commit bb88586

Please sign in to comment.