fixed path errors in generator script util
This commit is contained in:
parent
ff00d5f4f2
commit
84bd5ed856
2 changed files with 23 additions and 7 deletions
|
|
@ -27,9 +27,6 @@ var pack = function (params) {
|
|||
var createBundle = function(opts) {
|
||||
opts.dir = opts.dir || 'js/';
|
||||
|
||||
// concat browser vendor files
|
||||
exec('sh concat.sh', puts);
|
||||
|
||||
var bopts = {
|
||||
pack: pack,
|
||||
debug: true,
|
||||
|
|
|
|||
|
|
@ -2,12 +2,18 @@
|
|||
|
||||
#Description: A simple script to compile and copy only the needed files for the web app.
|
||||
|
||||
# Moving to root path
|
||||
cd ../
|
||||
ROOTDIR=`pwd`
|
||||
BASENAME=`basename $ROOTDIR`
|
||||
|
||||
if [ $BASENAME = "util" ]; then
|
||||
# Moving to root path
|
||||
cd ../
|
||||
ROOTDIR=`pwd`
|
||||
fi
|
||||
|
||||
# Configs
|
||||
APPDIR="./webapp"
|
||||
CHROMEDIR="./chrome-extension"
|
||||
APPDIR="$ROOTDIR/webapp"
|
||||
CHROMEDIR="$ROOTDIR/chrome-extension"
|
||||
|
||||
LIBDIR="$APPDIR/lib"
|
||||
DOWNLOADDIR="$APPDIR/download"
|
||||
|
|
@ -22,6 +28,14 @@ Yellow="1;33m"
|
|||
Green="1;32m"
|
||||
CloseColor="\033[0m"
|
||||
|
||||
# Check function OK
|
||||
checkOK() {
|
||||
if [ $? != 0 ]; then
|
||||
echo -e "${OpenColor}${Red}* ERROR. Exiting...${CloseColor}"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
# Create/Clean temp dir
|
||||
echo -e "${OpenColor}${Green}* Checking temp dir...${CloseColor}"
|
||||
if [ -d $APPDIR ]; then
|
||||
|
|
@ -40,22 +54,27 @@ mkdir -p $CHROMEDIR
|
|||
# Re-compile copayBundle.js
|
||||
echo -e "${OpenColor}${Green}* Generating copay bundle...${CloseColor}"
|
||||
grunt --target=dev shell
|
||||
checkOK
|
||||
|
||||
# Copy all app files
|
||||
echo -e "${OpenColor}${Green}* Copying all app files...${CloseColor}"
|
||||
cp -af {css,font,img,js,lib,sound,config.js,index.html} $APPDIR
|
||||
checkOK
|
||||
|
||||
# Copy all chrome-extension files
|
||||
echo -e "${OpenColor}${Green}* Copying all chrome-extension files...${CloseColor}"
|
||||
cp -af {css,font,img,js,lib,sound,config.js,index.html,popup.html,manifest.json} $CHROMEDIR
|
||||
checkOK
|
||||
|
||||
# Zipping apps
|
||||
echo -e "${OpenColor}${Green}* Zipping all app files...${CloseColor}"
|
||||
zip -r $ZIPFILE $APPDIR
|
||||
checkOK
|
||||
|
||||
# Zipping chrome-extension
|
||||
echo -e "${OpenColor}${Green}* Zipping all chrome-extension files...${CloseColor}"
|
||||
zip -r $CHROMEZIPFILE $CHROMEDIR
|
||||
checkOK
|
||||
|
||||
mkdir -p $CHROMEDOWNLOADDIR
|
||||
mv $ZIPFILE $DOWNLOADDIR
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue