-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path__init.sh
52 lines (45 loc) · 1.72 KB
/
__init.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
48
49
50
51
52
source /usr/local/bin/.app-deploy-sources/__constants.sh
function __init_deploy_options {
cat /usr/local/bin/.app-deploy-sources/deploy-options.sh > ./.deploy-options.sh
echo "The options file was generated successfully!"
echo "NOTE: Change default values to the project specific."
echo
}
function __init_changelog_generator {
cat /usr/local/bin/.app-deploy-sources/changelog-generator.sh > ./.changelog-generator.sh
echo "Changelog generator file was generated successfully!"
echo "NOTE: Change default implementation to the project specific."
echo " Examples can be found https://github.com/infinum/app-deploy-script/tree/master/examples/changelog_generator."
echo
}
#################################
# INIT NEW PROJECT #
#################################
function __init {
__header_print
if [ -e "./.deploy-options.sh" ]; then
echo "Options file already exists."
echo "If you continue, stored options will be overridden!"
echo
read -r -p "Do you want to proceed? [y/n] " c
if [[ ${c} =~ ^(yes|y|Y) ]] || [ -z ${c} ]; then
__init_deploy_options
fi
else
__init_deploy_options
fi
if [ -e "./.changelog-generator.sh" ]; then
echo "Changelog generator file already exists."
echo "If you continue, current implementation will be overridden!"
echo
read -r -p "Do you want to proceed? [y/n] " c
if [[ ${c} =~ ^(yes|y|Y) ]] || [ -z ${c} ]; then
__init_changelog_generator
fi
else
read -r -p "Add changelog generator file? [y/n] " c
if [[ ${c} =~ ^(yes|y|Y) ]] || [ -z ${c} ]; then
__init_changelog_generator
fi
fi
}