forked from hootrhino/rulex
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gen_info.sh
executable file
·42 lines (36 loc) · 1.09 KB
/
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
33
34
35
36
37
38
39
40
41
42
#! /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!!!
// Generated Time: "$(echo $(date "+%Y-%m-%d %H:%M:%S"))"
// Build on: $(uname -a)
//
package typex
type Version struct {
Version string
ReleaseTime string
}
var DefaultVersion = Version{
Version: \`${VERSION}\`,
ReleaseTime: "$(echo $(date "+%Y-%m-%d %H:%M:%S"))",
}
EOF
echo "Generate Version Susseccfully"
#######################################################################
## Gen banner
#######################################################################
cat >./utils/banner.txt <<EOF
|
|* Welcome to RULEX framework world <'_'>
|* Version: ${VERSION}-${HASH:0:15}
|* Build at: $(echo $(date "+%Y-%m-%d %H:%M:%S"))
|* Document: https://rulex.pages.dev
|
EOF
echo "Generate Banner Susseccfully"