Compare commits

...

2 commits

Author SHA1 Message Date
3806f579b9 Merge pull request 'Correctly link to BE commit in version tab' (#3) from sfr/pleroma-fe:develop into develop
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
Reviewed-on: http://akkoma.dev/AkkomaGang/pleroma-fe/pulls/3
2022-06-17 11:56:12 +00:00
Sol Fisher Romanoff
adc6b86e6b
Correctly link to BE commit in version tab 2022-06-14 22:13:51 +03:00
2 changed files with 15 additions and 4 deletions

View file

@ -1,7 +1,7 @@
import { extractCommit } from 'src/services/version/version.service'
const pleromaFeCommitUrl = 'https://akkoma.dev/AkkomaGang/pleroma-fe/commit/'
const pleromaBeCommitUrl = 'https://akkoma.dev/AkkomaGang/akkoma/commit/'
const pleromaBeCommitUrl = 'https://akkoma.dev/AkkomaGang/akkoma/commits/'
const VersionTab = {
data () {

View file

@ -1,6 +1,17 @@
export const extractCommit = versionString => {
const regex = /-g(\w+)/i
const matches = versionString.match(regex)
return matches ? matches[1] : ''
// X.Y.Z-1337-gdeadbeef => deadbeef
const commit = versionString.match(/-g(\w+)/i)
if (commit) {
return commit[1]
}
// X.Y.Z-develop => develop
const branch = versionString.match(/-([\w-/]+)$/i)
if (branch) {
return branch[1]
}
// X.Y.Z => vX.Y.Z
return 'v' + versionString
}