Skip to content

Commit

Permalink
fix: issue with restore.sh
Browse files Browse the repository at this point in the history
Fixed issue #1384
  • Loading branch information
lvca committed Dec 17, 2023
1 parent 9ddcc86 commit 568175f
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
4 changes: 4 additions & 0 deletions console/src/main/java/com/arcadedb/console/Console.java
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,10 @@ public void interactiveMode() throws IOException {
}

public static void main(final String[] args) throws IOException {
final String rootPath = GlobalConfiguration.SERVER_ROOT_PATH.getValueAsString();
if (rootPath == null)
GlobalConfiguration.SERVER_ROOT_PATH.setValue(".");

try {
execute(args);
} finally {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
*/
package com.arcadedb.integration.restore;

import com.arcadedb.GlobalConfiguration;
import com.arcadedb.database.DatabaseInternal;
import com.arcadedb.integration.importer.ConsoleLogger;
import com.arcadedb.integration.restore.format.AbstractRestoreFormat;
Expand All @@ -42,6 +43,10 @@ public Restore(final String file, final String databaseURL) {
}

public static void main(final String[] args) {
final String rootPath = GlobalConfiguration.SERVER_ROOT_PATH.getValueAsString();
if (rootPath == null)
GlobalConfiguration.SERVER_ROOT_PATH.setValue(".");

new Restore(args).restoreDatabase();
System.exit(0);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,8 @@ private RestoreInputSource openInputFile() throws IOException {

final File file = new File(path);
if (!file.exists())
throw new RestoreException(String.format("The backup file '%s' does not exist", settings.inputFileURL));
throw new RestoreException(String.format("The backup file '%s' does not exist (local path=%s)",//
settings.inputFileURL, new File(".").getAbsolutePath()));

return new RestoreInputSource(new FileInputStream(file), file.length());
}
Expand Down
4 changes: 0 additions & 4 deletions package/src/main/scripts/restore.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,6 @@ PRGDIR=`dirname "$PRG"`
# Only set ARCADEDB_HOME if not already set
[ -f "$ARCADEDB_HOME"/bin/console.sh ] || ARCADEDB_HOME=`cd "$PRGDIR/.." ; pwd`

cd "$ARCADEDB_HOME/bin"


# Raspberry Pi check (Java VM does not run with -server argument on ARMv6)
if [ `uname -m` != "armv6l" ]; then
JAVA_OPTS="$JAVA_OPTS -server "
Expand All @@ -49,7 +46,6 @@ else
JAVA=java
fi


if [ -z "$JAVA_OPTS_SCRIPT" ] ; then
JAVA_OPTS_SCRIPT="-XX:+HeapDumpOnOutOfMemoryError -Djava.awt.headless=true -Dfile.encoding=UTF8 -Dpolyglot.engine.WarnInterpreterOnly=false"
fi
Expand Down

0 comments on commit 568175f

Please sign in to comment.