Skip to content
This repository was archived by the owner on Nov 26, 2020. It is now read-only.

Commit d559e20

Browse files
authored
Merge pull request #43 from davidtwco/rust-lang/rust-issue-29893
Fix issues with rustc documentation unpacking.
2 parents 85fc2f5 + 15ebfc2 commit d559e20

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

promote-release/src/main.rs

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -390,8 +390,7 @@ upload-addr = \"{}/{}\"
390390

391391
// Unpack the regular documentation tarball.
392392
let tarball_prefix = format!("rust-docs-{}-{}", version, target);
393-
let tarball = format!("{}.tar.gz",
394-
self.dl_dir().join(&tarball_prefix).display());
393+
let tarball = format!("{}.tar.gz", self.dl_dir().join(&tarball_prefix).display());
395394
let tarball_dir = format!("{}/rust-docs/share/doc/rust/html", tarball_prefix);
396395
run(Command::new("tar")
397396
.arg("xf")
@@ -402,22 +401,22 @@ upload-addr = \"{}/{}\"
402401

403402
// Construct path to rustc documentation.
404403
let tarball_prefix = format!("rustc-docs-{}-{}", version, target);
405-
let tarball = format!("{}.tar.gz",
406-
self.dl_dir().join(&tarball_prefix).display());
404+
let tarball = format!("{}.tar.gz", self.dl_dir().join(&tarball_prefix).display());
405+
// Construct the path that contains the documentation inside the tarball.
406+
let tarball_dir = format!("{}/rustc-docs/share/doc/rust/html", tarball_prefix);
407407

408408
// Only create and unpack rustc docs if artefacts include tarball.
409409
if Path::new(&tarball).exists() {
410-
// Create the subdirectory that we will extract our nighly documentation into.
411-
let tarball_dir = format!("{}/nightly-rustc", tarball_dir);
412-
t!(fs::create_dir_all(&tarball_dir));
410+
let rustc_docs = docs.join("nightly-rustc");
411+
t!(fs::create_dir_all(&rustc_docs));
413412

414413
// Unpack the rustc documentation into the new directory.
415414
run(Command::new("tar")
416415
.arg("xf")
417416
.arg(&tarball)
418417
.arg("--strip-components=6")
419418
.arg(&tarball_dir)
420-
.current_dir(&docs));
419+
.current_dir(&rustc_docs));
421420
}
422421

423422
// Upload this to `/doc/$channel`

0 commit comments

Comments
 (0)