-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild
More file actions
80 lines (63 loc) · 1.94 KB
/
Copy pathbuild
File metadata and controls
80 lines (63 loc) · 1.94 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
#!/bin/bash
PROJECT="youpay-opencart-30x"
ZIP="${PROJECT}.zip"
TARGETDIR="upload"
######## Setup Functions #############
# prints colored text
print_style () {
if [ "$2" == "info" ] ; then
COLOR="96m";
elif [ "$2" == "success" ] ; then
COLOR="92m";
elif [ "$2" == "warning" ] ; then
COLOR="93m";
elif [ "$2" == "danger" ] ; then
COLOR="91m";
else #default color
COLOR="0m";
fi
STARTCOLOR="\e[$COLOR";
ENDCOLOR="\e[0m";
printf "$STARTCOLOR%b$ENDCOLOR" "$1";
}
################################################
print_style "===== YouPay OpenCart Build and Release =====\n" "danger";
echo "this will build and release this package for you"
printf "\n"
################################################
print_style "Preping...." "info"
rm -rf ${TARGETDIR}
print_style "." "info"
mkdir "${TARGETDIR}"
print_style ".\n" "info"
print_style "Copying all files" "info"
for file in *
do
if [ "$file" != "$TARGETDIR" ] && [ "$file" != "vendor" ] && [ "$file" != "build" ] && [ "$file" != "$ZIP" ] && [ "$file" != "README.txt" ]
then
cp -r "$file" "$TARGETDIR/";
print_style "." "success"
elif [ "$file" == "README.txt" ]
then
cp -r "$file" ".";
print_style "." "success"
fi
done
print_style "✓" "success"
printf "\n"
cd $TARGETDIR || ( print_style "Changing Directory Failed" "error" && exit );
print_style "Installing Composer...\n" "info"
composer install --no-ansi --no-dev --no-interaction --no-plugins --no-progress --no-scripts --no-suggest --optimize-autoloader --classmap-authoritative &>/dev/null
print_style "Composer Installed\n" "success"
rm -rf composer.json
rm -rf composer.lock
cd ../
print_style "Zipping\n" "info"
zip -r $ZIP $TARGETDIR README.txt &>/dev/null
print_style "File Packaged Up Successfully\n" "success"
print_style "...cleaning up" "info"
rm -rf ${TARGETDIR}
print_style "\n\nBuild Completed:\n" "success"
print_style "./${ZIP}\n\n" "info"
echo ""
exit;