Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 23 additions & 7 deletions src/main/java/com/senzing/sdk/core/InstallUtilities.java
Original file line number Diff line number Diff line change
Expand Up @@ -497,20 +497,36 @@ static File findSenzingPathFromLib() {
/**
* Finds the Senzing build version JSON file.
*
* @return THe Senzing build version JSON file.
* @return The Senzing build version JSON file.
*/
static File findBuildVersionFile() {
if (SENZING_PATH == null) {
return null;
}
File erDir = new File(SENZING_PATH, "er");
if (!erDir.exists() || !erDir.isDirectory()) {
return null;

// declare the version file
File versionFile = null;

// check if we might be building the Senzing product
if (SENZING_PATH.getName().equalsIgnoreCase("dist")) {
versionFile = new File(SENZING_PATH, "szBuildVersion.json");
if (!versionFile.exists() || !versionFile.isFile()) {
versionFile = null;
}
}
File versionFile = new File(erDir, "szBuildVersion.json");
if (!versionFile.exists() || !versionFile.isFile()) {
return null;

// fall back to a completed build structure if versionFile not found
if (versionFile == null) {
File erDir = new File(SENZING_PATH, "er");
if (!erDir.exists() || !erDir.isDirectory()) {
return null;
}
versionFile = new File(erDir, "szBuildVersion.json");
if (!versionFile.exists() || !versionFile.isFile()) {
return null;
}
}

try {
return versionFile.getCanonicalFile();

Expand Down
Loading