forked from hootrhino/rulex
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gen_info.sh
33 lines (28 loc) · 808 Bytes
/
gen_info.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#! /bin/bash
VERSION="$(git describe --tags $(git rev-list --tags --max-count=1))"
HASH=$(git rev-list --tags --max-count=1)
#######################################################################
## Gen Version
#######################################################################
cat >./typex/version.go <<EOF
// Warning:
//
// This file is generated by go compiler, don't change it!!!
package typex
type Version struct {
Version string
ReleaseTime string
Arch string
Dist string
}
var DefaultVersion = Version{
Version: \`${VERSION}\`,
ReleaseTime: "$(echo $(date "+%Y-%m-%d %H:%M:%S"))",
}
var Banner = \`
** Welcome to RULEX framework world <'_'>
** Version: ${VERSION}-${HASH:0:15}
** Document: https://rulex.pages.dev
\`
EOF
echo "Generate Version Susseccfully"