File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ use std:: env;
12use std:: process:: Command ;
23
34fn main ( ) {
4- // Tell Cargo that if the given file changes, to rerun this build script.
5- println ! ( "cargo:rerun-if-changed=Cargo.lock" ) ;
6-
75 let output = Command :: new ( "cargo" )
86 . args ( & [ "tree" , "--quiet" , "--color" , "never" ] )
97 . output ( )
@@ -18,5 +16,7 @@ fn main() {
1816 . collect ( ) ;
1917 let deps = deps. trim_end ( ) ;
2018
21- std:: fs:: write ( "./dependencies.txt" , deps) . expect ( "could not write to file `dependencies.txt`" ) ;
19+ let mut path = env:: var ( "OUT_DIR" ) . unwrap ( ) ;
20+ path. push_str ( "/dependencies.txt" ) ;
21+ std:: fs:: write ( & path, deps) . expect ( "could not write to file `dependencies.txt`" ) ;
2222}
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ pub const APP_NAME: &str = env!("CARGO_PKG_NAME");
2020pub const APP_VERSION : & str = env ! ( "CARGO_PKG_VERSION" ) ;
2121
2222/// The dependency tree, generated by the build script
23- pub const DEPENDENCIES : & str = include_str ! ( "../../ dependencies.txt") ;
23+ pub const DEPENDENCIES : & str = include_str ! ( concat! ( env! ( "OUT_DIR" ) , "/ dependencies.txt") ) ;
2424
2525/// Color spaces, as they can be provided in the command line
2626const COLOR_FORMATS : & [ & str ] = & [
You can’t perform that action at this time.
0 commit comments