Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(34)

Unified Diff: cipd/version/version.go

Issue 2527753002: Make selfupdate maintain client version as well. (Closed)
Patch Set: Refactor so that tests can operate Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cipd/client/cipd/client_test.go ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cipd/version/version.go
diff --git a/cipd/version/version.go b/cipd/version/version.go
index 4b5e04dc2a80e59c9a72802e1655d43415dc3e9d..4ae07ba70d41e2c7fb35ac392245eb7d8b8bcbed 100644
--- a/cipd/version/version.go
+++ b/cipd/version/version.go
@@ -98,10 +98,15 @@ func recoverSymlinkPath(p string) string {
return strings.Join(append(chunks[:i], chunks[i+4:]...), string(filepath.Separator))
}
-func getCurrentVersion(exePath string) (Info, error) {
+// GetVersionFile returns the path to the version file corresponding to the
+// provided exe. This isn't typically needed, but can be useful for debugging.
+func GetVersionFile(exePath string) string {
// <root>/.versions/exename.cipd_version
- p := filepath.Join(filepath.Dir(exePath), ".versions", filepath.Base(exePath)+".cipd_version")
- if vf, _ := readVersionFile(p); vf.InstanceID != "" {
+ return filepath.Join(filepath.Dir(exePath), ".versions", filepath.Base(exePath)+".cipd_version")
+}
+
+func getCurrentVersion(exePath string) (Info, error) {
+ if vf, _ := readVersionFile(GetVersionFile(exePath)); vf.InstanceID != "" {
return vf, nil
}
// <root>/exename.cipd_version
« no previous file with comments | « cipd/client/cipd/client_test.go ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698