API.js generated version on go:generate

pull/792/head
hunterlong 2020-08-20 00:42:43 -07:00
parent 0eba5881be
commit 09640d0032
3 changed files with 7 additions and 11 deletions

View File

@ -4,17 +4,13 @@ const qs = require('querystring');
axios.defaults.withCredentials = true
const tokenKey = "statping_auth";
const version = "0.90.64";
const commit = "8b54ceb16f0e2ca6c4f5b8f0fe3b5cc2598dc594";
class Api {
constructor() {
this.version = "0.90.64";
this.commit = "0eba5881be48fde3e25f1078e5784ee7eb258788";
}
version = () => version
commit = () => commit
async oauth() {
const oauth = axios.get('api/oauth').then(response => (response.data))
return oauth

View File

@ -2275,7 +2275,7 @@ OluFxewsEO0QNDrfFb+0gnjYlnGqOFcZjUMXbDdY5oLSPtXohynuTK1qyQ==
</div>
<div class="text-center small text-dim" v-pre>
Automatically generated from Statping's Wiki on 2020-08-20 04:46:47.972956 &#43;0000 UTC
Automatically generated from Statping's Wiki on 2020-08-20 07:40:33.788807 &#43;0000 UTC
</div>
</div>

View File

@ -12,8 +12,8 @@ import (
"strings"
)
const replace = `const version = "[0-9]\.[0-9]{2}\.[0-9]{2}";`
const replaceCommit = `const commit = \"[a-z0-9]{40}\"\;`
const replace = `this\.version = "[0-9]\.[0-9]{2}\.[0-9]{2}";`
const replaceCommit = `this\.commit = \"[a-z0-9]{40}\"\;`
func main() {
fmt.Println("RUNNING: ./source/generate_version.go")
@ -28,8 +28,8 @@ func main() {
fmt.Println("git commit: ", gitCommit)
replaceWith := `const version = "` + strings.TrimSpace(string(version)) + `";`
replaceCommitWith := `const commit = "` + gitCommit + `";`
replaceWith := `this.version = "` + strings.TrimSpace(string(version)) + `";`
replaceCommitWith := `this.commit = "` + gitCommit + `";`
vRex := regexp.MustCompile(replace)
newApiFile := vRex.ReplaceAllString(string(apiJsFile), replaceWith)