mirror of
https://akkoma.dev/AkkomaGang/akkoma-fe.git
synced 2024-11-08 17:39:09 +00:00
Correctly link to BE commit in version tab
This commit is contained in:
parent
36309ebe04
commit
adc6b86e6b
2 changed files with 15 additions and 4 deletions
|
@ -1,7 +1,7 @@
|
||||||
import { extractCommit } from 'src/services/version/version.service'
|
import { extractCommit } from 'src/services/version/version.service'
|
||||||
|
|
||||||
const pleromaFeCommitUrl = 'https://akkoma.dev/AkkomaGang/pleroma-fe/commit/'
|
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 = {
|
const VersionTab = {
|
||||||
data () {
|
data () {
|
||||||
|
|
|
@ -1,6 +1,17 @@
|
||||||
|
|
||||||
export const extractCommit = versionString => {
|
export const extractCommit = versionString => {
|
||||||
const regex = /-g(\w+)/i
|
// X.Y.Z-1337-gdeadbeef => deadbeef
|
||||||
const matches = versionString.match(regex)
|
const commit = versionString.match(/-g(\w+)/i)
|
||||||
return matches ? matches[1] : ''
|
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
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue