-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsdb
More file actions
88 lines (64 loc) · 1.63 KB
/
sdb
File metadata and controls
88 lines (64 loc) · 1.63 KB
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# 0 : Commit Publish
# 1 : Publish only
read -p 'Publish only 1 (Commit Publish 0) :' commitPublish
commitPublish=${commitPublish:-0}
fileComment=0
# Commit and push
if [ "$commitPublish" == 0 ]
then
# get git commit message
read -p 'Git Message :' gitMsg
gitMsg=${gitMsg:-0}
fileComment=$gitMsg
commitMSg=$gitMsg
# if empty get added auto commit
if [ "$gitMsg" == 0 ]
then
commitMSg="Auto Commited"
fi
echo "Git commited -> $commitMSg"
git add . && git commit -am "${commitMSg}"
fi
# Input from cmd
read -p 'test -> 1 or prod -> 0 : (0 prod) :' env
# default value set
env=${env:-0}
# 0 :prod
# 1 :test
# production or test
if [ "$env" == 0 ]
then
env='prod'
elif [ "$env" == 1 ]
then
env='test'
else
echo "${ env } <= wtf :( wrong env try again !"
exit
fi
printf '*\n'
printf '\n******************************************\n'
# cat .env.$env
cat src/environments/environment.$env.ts
printf '\n******************************************\n'
printf '*\n'
# bild the project
# npm run-script build:$env
./buildProd
# if empty input get git last commit msg
if [ "$fileComment" == 0 ]
then
fileComment=$(git log -1 --pretty=%s)
fi
# convert to space to dash
dashedString=$(sed "s/ /_/g" <<< $fileComment)
dashedString=$(sed "s/://g" <<< $dashedString)
# get date
dateTime=$(date +'%Y%m%d_%H%M')
# concaenate and build convert to zip
cd && start WinRAR.exe a -afzip "dialog-invest_${dateTime}_${env}_${dashedString}.zip" ./dist *.*
cd ..
echo "build file name is dialog-invest_${dateTime}_${env}_${dashedString}.zip"
start .
# mv build/"dialog-invest_${dateTime}_${env}_${dashedString}.zip" .
exit