alpha
Login
or
Join now
oyster.cafe
/
tangled-core
forked from
tangled.org/core
Star
0
Fork
0
Atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
Monorepo for Tangled
Star
0
Fork
0
Atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
Overview
Issues
Pulls
Pipelines
knotserver: print vcs revision info
author
nasso
committer
Tangled
date
10 months ago
(Aug 31, 2025, 6:01 PM UTC)
commit
ca22fa2b
ca22fa2be59192ef288b01fa5c11d2c38f939dad
parent
07b009bd
07b009bd6b986875352905b395e672b53cdf945e
+22
-2
1 changed file
Expand all
Collapse all
Unified
Split
knotserver
routes.go
+22
-2
knotserver/routes.go
Reviewed
···
156
156
}
157
157
158
158
var modVer string
159
159
+
var sha string
160
160
+
var modified bool
161
161
+
159
162
for _, mod := range info.Deps {
160
163
if mod.Path == "tangled.sh/tangled.sh/knotserver" {
161
161
-
version = mod.Version
164
164
+
modVer = mod.Version
162
165
break
163
166
}
164
167
}
165
168
169
169
+
for _, setting := range info.Settings {
170
170
+
switch setting.Key {
171
171
+
case "vcs.revision":
172
172
+
sha = setting.Value
173
173
+
case "vcs.modified":
174
174
+
modified = setting.Value == "true"
175
175
+
}
176
176
+
}
177
177
+
166
178
if modVer == "" {
167
167
-
version = "unknown"
179
179
+
modVer = "unknown"
180
180
+
}
181
181
+
182
182
+
if sha == "" {
183
183
+
version = modVer
184
184
+
} else if modified {
185
185
+
version = fmt.Sprintf("%s (%s with modifications)", modVer, sha)
186
186
+
} else {
187
187
+
version = fmt.Sprintf("%s (%s)", modVer, sha)
168
188
}
169
189
}
170
190