@@ -88,19 +88,18 @@ fn main() -> anyhow::Result<()> {
88
88
// - a tmp directory, generated by rustdoc
89
89
// we would like a directory we have write access to. if we assume cargo-like directories,
90
90
// we end up with the path `/wbg-out`
91
- let tmpdir = if wasm_file_to_test
92
- . to_string_lossy ( )
93
- . starts_with ( "/tmp/rustdoc" )
94
- {
95
- wasm_file_to_test. parent ( ) // chop off the file name and give us the /tmp/rustdoc<hash> directory
96
- } else {
97
- wasm_file_to_test
98
- . parent ( ) // chop off file name
99
- . and_then ( |p| p. parent ( ) ) // chop off `deps`
100
- . and_then ( |p| p. parent ( ) ) // chop off `debug`
101
- }
102
- . map ( |p| p. join ( format ! ( "wbg-tmp-{}" , file_name) ) )
103
- . ok_or_else ( || anyhow ! ( "file to test doesn't follow the expected Cargo conventions" ) ) ?;
91
+ let wasm_file_str = wasm_file_to_test. to_string_lossy ( ) ;
92
+ let tmpdir =
93
+ if wasm_file_str. starts_with ( "/tmp/rustdoc" ) || wasm_file_str. starts_with ( "/var/folders" ) {
94
+ wasm_file_to_test. parent ( ) // chop off the file name and give us the /tmp/rustdoc<hash> directory
95
+ } else {
96
+ wasm_file_to_test
97
+ . parent ( ) // chop off file name
98
+ . and_then ( |p| p. parent ( ) ) // chop off `deps`
99
+ . and_then ( |p| p. parent ( ) ) // chop off `debug`
100
+ }
101
+ . map ( |p| p. join ( format ! ( "wbg-tmp-{}" , file_name) ) )
102
+ . ok_or_else ( || anyhow ! ( "file to test doesn't follow the expected Cargo conventions" ) ) ?;
104
103
105
104
// Make sure there's no stale state from before
106
105
drop ( fs:: remove_dir_all ( & tmpdir) ) ;
0 commit comments