File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
bitcoind-tests/tests/setup Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -11,8 +11,14 @@ pub fn setup() -> BitcoinD {
11
11
// Create env var BITCOIND_EXE_PATH to point to the ../bitcoind/bin/bitcoind binary
12
12
let key = "BITCOIND_EXE" ;
13
13
if std:: env:: var ( key) . is_err ( ) {
14
- let curr_dir_path = std:: env:: current_dir ( ) . unwrap ( ) ;
15
- let bitcoind_path = curr_dir_path. join ( "bin" ) . join ( "bitcoind" ) ;
14
+ let mut root_path = std:: env:: current_dir ( ) . unwrap ( ) ;
15
+ while std:: fs:: metadata ( root_path. join ( "LICENSE" ) ) . is_err ( ) {
16
+ if !root_path. pop ( ) {
17
+ panic ! ( "Could not find LICENSE file; do not know where repo root is." ) ;
18
+ }
19
+ }
20
+
21
+ let bitcoind_path = root_path. join ( "bitcoind-tests" ) . join ( "bin" ) . join ( "bitcoind" ) ;
16
22
std:: env:: set_var ( key, bitcoind_path) ;
17
23
}
18
24
You can’t perform that action at this time.
0 commit comments