File tree Expand file tree Collapse file tree 3 files changed +10
-9
lines changed Expand file tree Collapse file tree 3 files changed +10
-9
lines changed Original file line number Diff line number Diff line change @@ -112,7 +112,6 @@ jobs:
112112 yarn
113113 wget --quiet https://github.com/trail-of-forks/sbpf-coverage/releases/download/$AGAVE_TAG/patched-agave-tools-$AGAVE_TAG-Linux.tar.gz
114114 tar xzf patched-agave-tools-$AGAVE_TAG-Linux.tar.gz
115- rm -f patched-agave-tools-$AGAVE_TAG-Linux.tar.gz
116115 PATH="$PWD/patched-agave-tools-$AGAVE_TAG-Linux/bin:$PATH"
117116 anchor test
118117 popd
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ use assert_cmd::cargo::CommandCargoExt;
44use std:: {
55 collections:: HashSet ,
66 env:: current_dir,
7- fs:: { read_to_string, remove_file } ,
7+ fs:: read_to_string,
88 path:: { Path , PathBuf } ,
99 process:: Command ,
1010 sync:: { LazyLock , Mutex , MutexGuard } ,
@@ -242,8 +242,6 @@ fn download_patched_agave_tools(dir: impl AsRef<Path>) -> Result<()> {
242242 let status = command. status ( ) ?;
243243 ensure ! ( status. success( ) , "command failed: {command:?}" ) ;
244244
245- remove_file ( dir. as_ref ( ) . join ( filename) ) ?;
246-
247245 Ok ( ( ) )
248246}
249247
Original file line number Diff line number Diff line change @@ -25,16 +25,20 @@ pub fn patched_agave_tools(path: impl AsRef<Path>) -> Result<Option<PathBuf>> {
2525 for result in read_dir ( path) ? {
2626 let entry = result?;
2727 let path = entry. path ( ) ;
28- let Some ( file_name) = path. file_name ( ) else {
28+ let Some ( file_name) = path. file_name ( ) . and_then ( OsStr :: to_str ) else {
2929 continue ;
3030 } ;
31- if file_name
32- . to_str ( )
33- . is_none_or ( |s| !s. starts_with ( "patched-agave-tools-" ) )
34- {
31+ if !file_name. starts_with ( "patched-agave-tools-" ) {
3532 continue ;
3633 }
3734 if !path. is_dir ( ) {
35+ // smoelius: Don't warn if there is an adjacent directory with the same basename.
36+ if let Some ( file_stem) = file_name. strip_suffix ( ".tar.gz" )
37+ && let Some ( parent) = path. parent ( )
38+ && parent. join ( file_stem) . is_dir ( )
39+ {
40+ continue ;
41+ }
3842 eprintln ! (
3943 "Warning: Found `{}` but it is not a directory. If it contains patched Agave \
4044 tools that you want to use, please unzip and untar it.",
You can’t perform that action at this time.
0 commit comments