Skip to content
This repository has been archived by the owner on Dec 31, 2022. It is now read-only.

Commit

Permalink
Fixes automatic binary detection for cryptodoge
Browse files Browse the repository at this point in the history
  • Loading branch information
gilnobrega committed Aug 30, 2021
1 parent f2c6e29 commit d3e691a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
2 changes: 1 addition & 1 deletion environment_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ environment_config:
fields: # set of fields for command
version: # key name
const: true # optional, default to TRUE
default: 1.7.5.2 # optional, default value for key, if not provided key will be required during command run
default: 1.7.5.3 # optional, default value for key, if not provided key will be required during command run
dotenv: true # optional, default to FALSE, if this field should be added to .env file

13 changes: 3 additions & 10 deletions lib/cache.dart
Original file line number Diff line number Diff line change
Expand Up @@ -307,10 +307,6 @@ Make sure this folder has the same structure as Chia's GitHub repo.""");
file =
"/resources/app.asar.unpacked/daemon/${_blockchain.binaryName}.exe";

//cryptodoge only
if (_blockchain.binaryName == "cryptodoge")
file = file.replaceAll("/daemon", "");

if (chiaRootDir.existsSync()) {
chiaRootDir.listSync(recursive: false).forEach((dir) {
io.File trypath = io.File(dir.path + file);
Expand Down Expand Up @@ -341,8 +337,9 @@ Make sure this folder has the same structure as Chia's GitHub repo.""");
List<String> possiblePaths = [];

if (io.Platform.isLinux) {
chiaRootDir =
io.Directory("/usr/lib/${_blockchain.binaryName}-blockchain");
chiaRootDir = io.Directory(
//different structure for cryptodoge
"/usr/lib/${_blockchain.binaryName}${(_blockchain.binaryName != "cryptodoge") ? "-blockchain" : ""}");
file = "/resources/app.asar.unpacked/daemon/${_blockchain.binaryName}";
} else if (io.Platform.isMacOS) {
//capitalizes first letter of a string
Expand All @@ -359,13 +356,9 @@ Make sure this folder has the same structure as Chia's GitHub repo.""");
// checks if binary exists in /package:farmr_client/chia-blockchain/resources/app.asar.unpacked/daemon/chia in linux or
// checks if binary exists in /Applications/Chia.app/Contents/Resources/app.asar.unpacked/daemon/chia in macOS
chiaRootDir.path + file,
//cryptodoge only
chiaRootDir.path + file.replaceAll("/daemon", ""),

// Checks if binary exists in /usr/package:farmr_client/chia-blockchain/resources/app.asar.unpacked/daemon/chia
"/usr" + chiaRootDir.path + file,
//cryptodoge only
"/usr" + chiaRootDir.path + file.replaceAll("/daemon", ""),

//checks if binary exists in /home/user/.local/bin/chia
io.Platform.environment['HOME']! +
Expand Down

0 comments on commit d3e691a

Please sign in to comment.