forked from richelbilderbeek/TestEntrance
-
Notifications
You must be signed in to change notification settings - Fork 0
/
zip.sh
executable file
·81 lines (69 loc) · 2.08 KB
/
zip.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
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
#!/bin/sh
#zip packs all the files to port into a single .zip file,
#minicking the same folder structure
#Folder structure
# *
# * Classes
# * CppAbout
# * CppIpAddress
# * CppWtAboutDialog
# * CppWtAutoConfig
# * CppWtEntrance
# * Tools
# * ToolTestEntrance
echo "Removing old user information"
FOLDERNAME=ToolTestEntrance
FILENAME=$FOLDERNAME"Source_1_0"
ZIP_FILENAME=$FILENAME".zip"
HTM_FILENAME=$FILENAME".htm"
rm *.user
rm $ZIP_FILENAME
rm $HTM_FILENAME
echo "Mimicking file structure"
mkdir temp_zip
mkdir temp_zip/Classes
mkdir temp_zip/Classes/CppAbout
mkdir temp_zip/Classes/CppIpAddress
mkdir temp_zip/Classes/CppWtAboutDialog
mkdir temp_zip/Classes/CppWtAutoConfig
mkdir temp_zip/Classes/CppWtEntrance
mkdir temp_zip/Tools
mkdir temp_zip/Tools/ToolTestEntrance
echo "Copying files"
cp ../../Classes/CppAbout/*.* temp_zip/Classes/CppAbout
cp ../../Classes/CppIpAddress/*.* temp_zip/Classes/CppIpAddress
cp ../../Classes/CppWtAboutDialog/*.* temp_zip/Classes/CppWtAboutDialog
cp ../../Classes/CppWtAutoConfig/*.* temp_zip/Classes/CppWtAutoConfig
cp ../../Classes/CppWtEntrance/*.* temp_zip/Classes/CppWtEntrance
cp ../../Tools/ToolTestEntrance/*.* temp_zip/Tools/ToolTestEntrance
echo "Compressing files"
cd temp_zip
zip -r $FILENAME Classes
#zip -r $FILENAME Libraries
#zip -r $FILENAME Projects
zip -r $FILENAME Tools
cd ..
cp "temp_zip/"$ZIP_FILENAME $ZIP_FILENAME
echo "Cleaning up"
#Classes
rm temp_zip/Classes/CppAbout/*.*
rm temp_zip/Classes/CppIpAddress/*.*
rm temp_zip/Classes/CppWtAboutDialog/*.*
rm temp_zip/Classes/CppWtAutoConfig/*.*
rm temp_zip/Classes/CppWtEntrance/*.*
rmdir temp_zip/Classes/CppAbout
rmdir temp_zip/Classes/CppIpAddress
rmdir temp_zip/Classes/CppWtAboutDialog
rmdir temp_zip/Classes/CppWtAutoConfig
rmdir temp_zip/Classes/CppWtEntrance
rmdir temp_zip/Classes
#Tools
rm temp_zip/Tools/ToolTestEntrance/*.*
rmdir temp_zip/Tools/ToolTestEntrance
rmdir temp_zip/Tools
rm temp_zip/*.*
rmdir temp_zip
echo "Done"
../../Tools/ToolCodeToHtmlConsole-build-desktop/codetohtml --source "../"$FOLDERNAME
cp $FOLDERNAME".htm" $HTM_FILENAME
rm $FOLDERNAME".htm"