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

feat: message if wrangler needs updating #1190

Merged
merged 23 commits into from
May 28, 2020

Conversation

EverlastingBugstopper
Copy link
Contributor

@EverlastingBugstopper EverlastingBugstopper commented Apr 3, 2020

Fixes #397

every 24 hours, wrangler will ping crates.io and ask for the latest version. if latest version is greater than currently installed version, a message will be printed stating that the version needs updating. it saves the result from crates.io at $WRANGLER_HOME/version.toml which includes the latest version and the time it was last checked.

@exvuma
Copy link
Contributor

exvuma commented Apr 3, 2020

Since there aren't tests yet could we add an undocumented/temp option to turn this off incase it breaks anyone? It could live in $WRANGLER_HOME/config/default.toml as

api_token="0xbd.."
warn_update="false"

We could remove this later once we know users aren't irritated by it

Just an idea. LGTM either way

src/util/version.rs Outdated Show resolved Hide resolved
Copy link
Contributor

@ashleymichal ashleymichal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

resist the junk drawer that is util.rs

@EverlastingBugstopper EverlastingBugstopper modified the milestones: 1.9.0, 1.10.0, 1.9.1 May 7, 2020
@EverlastingBugstopper EverlastingBugstopper modified the milestones: 1.9.1, 1.10.0 May 20, 2020
@EverlastingBugstopper EverlastingBugstopper requested a review from a team as a code owner May 26, 2020 15:09
@EverlastingBugstopper
Copy link
Contributor Author

so the only thing that needs to be done with this is making it only message once every 24 hours. right now, if your version of wrangler needs updating, it will print a message telling you to update after every single command. this shouldn't happen. Let's only bug folks about it once a day.

@ashleymichal ashleymichal dismissed their stale review May 26, 2020 15:38

utils gone!

src/version/mod.rs Outdated Show resolved Hide resolved
src/version/version.rs Outdated Show resolved Hide resolved
src/version/wrangler_version.rs Outdated Show resolved Hide resolved
src/version/wrangler_version.rs Outdated Show resolved Hide resolved
use std::thread;
use std::time::SystemTime;

use crate::settings::global_user::get_wrangler_home_dir;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: this probably does not belong to global_user, but idk where to put it just now.

@EverlastingBugstopper EverlastingBugstopper merged commit cc0c934 into master May 28, 2020
@ashleymichal ashleymichal deleted the avery/check-for-updates branch June 3, 2020 19:22
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Print update message on wrangler usage when new version of wrangler is available.
4 participants