-
Notifications
You must be signed in to change notification settings - Fork 539
Fix spacetime version list
not showing current version
#2680
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
base: master
Are you sure you want to change the base?
Conversation
Oh, whoops. I think the actual root cause is in a different function - this should be a thorough fix. It does mean that the current version will have to be re-set for it to work. diff --git a/crates/paths/src/cli.rs b/crates/paths/src/cli.rs
index 28d26fb81..f39761c09 100644
--- a/crates/paths/src/cli.rs
+++ b/crates/paths/src/cli.rs
@@ -85,7 +85,7 @@ impl VersionBinDir {
}
fn link_to(&self, path: &Path) -> anyhow::Result<()> {
- let rel_path = path.strip_prefix(self).unwrap_or(path);
+ let rel_path = path.strip_prefix(self.0.parent().unwrap()).unwrap_or(path);
#[cfg(unix)]
{
// remove the link if it already exists |
Ah okay! thanks for the better fix. Do you have any suggestions for how we fix this for people who already have SpacetimeDB installed? I guess it would just get quietly fixed the next time they upgrade? |
Yeah, that's the idea. |
Description of Changes
See #2679.
At some point, this code was changed so that
current
contains an entire path, rather than just the version string itself, so the comparison betweenver
andcurrent
was always failing.I'm not strongly attached to this particular approach to fixing, if there's a more principled way or a better function I should be using.
API and ABI breaking changes
Not a breaking change.
Expected complexity level and risk
1
Testing
I could be convinced to add a smoketest for this.