File tree Expand file tree Collapse file tree 3 files changed +10
-4
lines changed Expand file tree Collapse file tree 3 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ edition = "2018"
12
12
bitcoincore-rpc = " 0.13"
13
13
tempfile = " 3.1"
14
14
log = " 0.4"
15
- dirs-next = " 2.0.0 "
15
+ home = " 0.5.3 " # use same ver in build-dep
16
16
17
17
[dev-dependencies ]
18
18
env_logger = " 0.8"
@@ -22,6 +22,7 @@ ureq = "2.1"
22
22
bitcoin_hashes = " 0.9"
23
23
flate2 = " 1.0"
24
24
tar = " 0.4"
25
+ home = " 0.5.3"
25
26
26
27
[features ]
27
28
"0_21_1" = []
Original file line number Diff line number Diff line change @@ -36,7 +36,12 @@ fn main() {
36
36
}
37
37
let download_filename = download_filename ( ) ;
38
38
let expected_hash = get_expected_sha256 ( & download_filename) . unwrap ( ) ;
39
- let bitcoin_exe_home = format ! ( "{}/bitcoin" , std:: env:: var( "CARGO_HOME" ) . unwrap( ) ) ;
39
+ let bitcoin_exe_home = format ! (
40
+ "{}/bitcoin" ,
41
+ home:: cargo_home( )
42
+ . expect( "cannot determine CARGO_HOME" )
43
+ . display( )
44
+ ) ;
40
45
let existing_filename: PathBuf =
41
46
format ! ( "{}/bitcoin-{}/bin/bitcoind" , & bitcoin_exe_home, VERSION ) . into ( ) ;
42
47
Original file line number Diff line number Diff line change @@ -258,8 +258,8 @@ pub fn downloaded_exe_path() -> Option<String> {
258
258
// CARGO_HOME surely available only in `build.rs` here we need to get from home_dir
259
259
if versions:: HAS_FEATURE {
260
260
Some ( format ! (
261
- "{}/.cargo/ bitcoin/bitcoin-{}/bin/bitcoind" ,
262
- dirs_next :: home_dir ( ) ?. display( ) ,
261
+ "{}/bitcoin/bitcoin-{}/bin/bitcoind" ,
262
+ home :: cargo_home ( ) . ok ( ) ?. display( ) ,
263
263
versions:: VERSION
264
264
) )
265
265
} else {
You can’t perform that action at this time.
0 commit comments