Skip to content
This repository has been archived by the owner on Aug 3, 2023. It is now read-only.

Commit

Permalink
Merge branch 'master' into taylorlee/r2-bindings-and-subcommands
Browse files Browse the repository at this point in the history
  • Loading branch information
threepointone authored Dec 13, 2021
2 parents 31ccbc6 + 5131a94 commit bec9ffe
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 9 deletions.
6 changes: 6 additions & 0 deletions .cargo/audit.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[advisories]
# See https://github.com/cloudflare/wrangler/issues/2117
ignore = [
"RUSTSEC-2020-0159", # Potential segfault in `localtime_r` invocations
"RUSTSEC-2020-0071", # Potential segfault in the time crate
]
1 change: 1 addition & 0 deletions .github/workflows/audit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
paths:
- "**/Cargo.toml"
- "**/Cargo.lock"
- ".cargo/audit.toml"
- "**/package-lock.json"
- "**/npm-shrinkwrap.json"
schedule:
Expand Down
10 changes: 5 additions & 5 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 15 additions & 1 deletion npm/binary-install.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,21 @@ class Binary {

return axios({ url: this.url, responseType: "stream" })
.then(res => {
res.data.pipe(tar.x({ strip: 1, C: this.binaryDirectory }));
const writer = tar.x({ strip: 1, C: this.binaryDirectory });

return new Promise((resolve, reject) => {
res.data.pipe(writer);
let error = null;
writer.on('error', err => {
error = err;
reject(err);
});
writer.on('close', () => {
if (!error) {
resolve(true);
}
});
})
})
.then(() => {
console.log(
Expand Down
3 changes: 2 additions & 1 deletion npm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"postinstall": "node ./install-wrangler.js"
},
"bin": {
"wrangler": "./run-wrangler.js"
"wrangler": "./run-wrangler.js",
"wrangler1": "./run-wrangler.js"
},
"repository": {
"type": "git",
Expand Down
3 changes: 1 addition & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ fn main() -> Result<()> {
}
env_logger::init();

let latest_version_receiver = background_check_for_updates();
if let Ok(me) = env::current_exe() {
// If we're actually running as the installer then execute our
// self-installation, otherwise just continue as usual.
Expand All @@ -36,7 +35,7 @@ fn main() -> Result<()> {
}
}
run()?;
if let Ok(latest_version) = latest_version_receiver.try_recv() {
if let Ok(latest_version) = background_check_for_updates().try_recv() {
let latest_version = styles::highlight(latest_version.to_string());
let new_version_available = format!(
"A new version of Wrangler ({}) is available!",
Expand Down

0 comments on commit bec9ffe

Please sign in to comment.