Version links to BE/FE

This commit is contained in:
Edijs 2019-03-10 18:06:51 -07:00
parent 068c9724e4
commit 8952761370
3 changed files with 15 additions and 18 deletions

View file

@ -1,10 +1,6 @@
export const parseBackendVersionString = versionString => {
const regex = /(-g)(\w+)$/i
const replacer = '$1<a href="https://git.pleroma.social/pleroma/pleroma/commit/$2" target="_blank">$2</a>'
return versionString.replace(regex, replacer)
}
export const parseFrontendVersionString = versionString => {
return `<a href="https://git.pleroma.social/pleroma/pleroma-fe/commit/${versionString}" target="_blank">#${versionString}</a>`
export const extractCommit = versionString => {
const regex = /-g(\w+)$/i
const matches = versionString.match(regex)
return matches ? matches[1] : ''
}