mirror of
https://github.com/bisq-network/bisq.git
synced 2025-03-13 11:09:10 +01:00
Stop deletion of original bisq.properties during test harness setup
Stop the deletion of the original bisq.properties file after it's copied into the instances data directories.
This commit is contained in:
parent
a2ef728ee0
commit
1a931b815f
1 changed files with 5 additions and 21 deletions
|
@ -29,7 +29,6 @@ import java.io.File;
|
|||
import java.io.FileNotFoundException;
|
||||
import java.io.IOException;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
import java.util.concurrent.CountDownLatch;
|
||||
|
@ -247,14 +246,6 @@ public class Scaffold {
|
|||
// Bisq instance's DataDir
|
||||
copyBisqPropertiesFileToAppDataDir();
|
||||
|
||||
// Try to avoid confusion about which 'bisq.properties' file is or was loaded
|
||||
// by a Bisq instance: delete the 'bisq.properties' file automatically copied
|
||||
// to the 'apitest/build/resources/main' directory during IDE or Gradle build.
|
||||
// Note: there is no way to prevent this deleted file from being re-copied
|
||||
// from 'src/main/resources' to the buildDataDir each time you hit the build
|
||||
// button in the IDE.
|
||||
deleteRedundantBisqPropertiesFile();
|
||||
|
||||
// Copy the blocknotify script from the src resources dir to the build
|
||||
// resources dir. Users may want to edit comment out some lines when all
|
||||
// the default block notifcation ports being will not be used (to avoid
|
||||
|
@ -269,25 +260,18 @@ public class Scaffold {
|
|||
copyBisqPropertiesFileToAppDataDir(alicedaemon);
|
||||
copyBisqPropertiesFileToAppDataDir(bobdaemon);
|
||||
}
|
||||
private void copyBisqPropertiesFileToAppDataDir(BisqAppConfig bisqAppConfig) throws IOException, InterruptedException {
|
||||
String instanceDataDir = config.rootAppDataDir + "/" + bisqAppConfig.appName;
|
||||
|
||||
private void copyBisqPropertiesFileToAppDataDir(BisqAppConfig bisqAppConfig) throws IOException, InterruptedException {
|
||||
if (!new File(config.baseSrcResourcesDir + "/bisq.properties").exists()) return;
|
||||
|
||||
String instanceDataDir = config.rootAppDataDir + "/" + bisqAppConfig.appName;
|
||||
BashCommand moveToDataDir =
|
||||
new BashCommand("cp " + config.baseSrcResourcesDir + "/bisq.properties " + instanceDataDir);
|
||||
|
||||
if(moveToDataDir.run().getExitStatus() !=0)
|
||||
if (moveToDataDir.run().getExitStatus() != 0)
|
||||
throw new IllegalStateException("Could not copy bisq.properties to " + instanceDataDir);
|
||||
|
||||
log.debug("bisq.properties copied to " + instanceDataDir);
|
||||
}
|
||||
|
||||
private void deleteRedundantBisqPropertiesFile() throws IOException, InterruptedException {
|
||||
BashCommand rmRedundantBisqPropertiesFile =
|
||||
new BashCommand("rm -rf " + config.rootAppDataDir.getAbsolutePath() + "/bisq.properties");
|
||||
|
||||
if (rmRedundantBisqPropertiesFile.run().getExitStatus() != 0)
|
||||
throw new IllegalStateException("Could not delete redundant bisq.properties file");
|
||||
}
|
||||
|
||||
private void cleanDaoSetupDirectories() {
|
||||
String buildDataDir = config.rootAppDataDir.getAbsolutePath();
|
||||
|
|
Loading…
Add table
Reference in a new issue