Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix synchronization of docs #82

Merged
merged 2 commits into from
Apr 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ impl Context {
.read(true)
.write(true)
.create(true)
.truncate(true)
.open(self.work.join(".lock"))?;
file.try_lock_exclusive()?;
Ok(file)
Expand Down Expand Up @@ -468,8 +469,12 @@ impl Context {
let tarball_prefix = format!("rust-docs-{}-{}", version, target);
let tarball = format!("{}.tar.gz", self.dl_dir().join(&tarball_prefix).display());
let tarball_dir = format!("{}/rust-docs/share/doc/rust/html", tarball_prefix);

// The `m` flag touches all extracted files, therefore setting their modification time
// to the current date. This will cause the sync to overwrite all remote files with the
// local files.
run(Command::new("tar")
.arg("xf")
.arg("xfm")
.arg(&tarball)
.arg("--strip-components=6")
.arg(&tarball_dir)
Expand Down
Loading