-
Notifications
You must be signed in to change notification settings - Fork 8
/
version.sh
executable file
·47 lines (33 loc) · 1005 Bytes
/
version.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
43
44
45
46
47
#!/usr/bin/env bash
version_file=src/app/app.globals.ts
CURRENT_VERSION=$(node -p "require('./package.json').version")
CURRENT_HOMEPAGE=$(node -p "require('./package.json').homepage")
CURRENT_DAY=$(date +"%d.")
CURRENT_MONTH=$(LC_ALL=de_DE.UTF-8 date +"%B");
CURRENT_YEAR=$(date +"%Y")
CURRENT_DATE="$CURRENT_DAY $CURRENT_MONTH $CURRENT_YEAR"
echo "Updating app globals...
"
> $version_file
echo "// THIS IS AN AUTO-GENERATED FILE. DO NOT CHANGE IT MANUALLY!
// Generated last time on $(date)
/**
* The latest version of the AWG App
*/
export const appVersion = '$CURRENT_VERSION';
/**
* The release date of the latest version of the AWG App
*/
export const appVersionReleaseDate = '$CURRENT_DATE';
/**
* The URL of the AWG App
*/
export const appHomepage = '$CURRENT_HOMEPAGE';" >> $version_file
echo "Adding global file to git...
"
git add $version_file
echo "Updated app globals to
... version: $CURRENT_VERSION
... version date: $CURRENT_DATE
... homepage: $CURRENT_HOMEPAGE
Done."