use just last part of pathname in the tar

Previously:
```
$ curl -s http://localhost:8000/target/release/build.tar -o - | tar tf -
target/release/build/rayon-core-b8ae11d289218da3
…
```

Now:
```
$ curl -s http://localhost:8000/target/release/build.tar -o - | tar tf -
build/rayon-core-b8ae11d289218da3
…
```
This commit is contained in:
Дамјан Георгиевски 2018-07-07 15:48:22 +02:00
parent de0040512b
commit 62a99f8dc3

View file

@ -11,8 +11,9 @@ pub fn run_tar_in_thread(path: PathBuf) -> futures::sync::mpsc::UnboundedReceive
thread::spawn(move || {
let mut a = tar::Builder::new(writer);
let last_path_component = path.file_name().unwrap();
a.mode(tar::HeaderMode::Deterministic);
a.append_dir_all(path.clone(), path);
a.append_dir_all(last_path_component, &path);
a.finish();
});
stream