-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathpackage.sh
executable file
·26 lines (20 loc) · 1.04 KB
/
package.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
#!/bin/sh
SRCDIR=src
BUILDDIR=build
PACKAGEDIR=sdkappcollection
if [ ! -e $BUILDDIR ]; then mkdir $BUILDDIR; fi
rm -f build/*.tar
cd $SRCDIR
for appdir in `ls -1 .`; do
tar -cf ../$BUILDDIR/$appdir.tar $appdir # create .tar for all apps
done
for appdir in `ls -1 .`; do
tar -czf ../$BUILDDIR/$appdir.tgz $appdir # create .tgz for all apps
done
cd .. # navigate to the root level of sdk-app-collection
cd .. # navigate to one level up from sdk-app-collection
if [ -d $PACKAGEDIR ]; then rm -Rf $PACKAGEDIR; fi # remove if sdkappcollection already exists
mkdir $PACKAGEDIR # create an sdkappcollection directory
cp -a ./sdk-app-collection/* ./$PACKAGEDIR/ # copy the content from sdk-app-collection to sdkappcollection
tar -czf $PACKAGEDIR.tgz $PACKAGEDIR # create a sdkappcollection.tgz from sdkappcollection
rm -Rf $PACKAGEDIR # remove sdkappcollection