mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-02 06:06:10 -04:00
webui: redefined building webui
on linux: 'make' don't build libresapi every time anymore, it now knows when, what and how to 'build' webui on windows: builds old style
This commit is contained in:
parent
baf940443d
commit
0a6ae559fd
2 changed files with 113 additions and 37 deletions
|
@ -2,7 +2,7 @@
|
|||
|
||||
# create webfiles from sources at compile time (works without npm/node.js)
|
||||
|
||||
if [ "$1" = "" ];then
|
||||
if [ "$1" = "" ]; then
|
||||
publicdest=../../webui
|
||||
src=..
|
||||
else
|
||||
|
@ -10,34 +10,53 @@ else
|
|||
src=$1/webui-src
|
||||
fi
|
||||
|
||||
if [ -d "$publicdest" ]; then
|
||||
echo remove existing $publicdest
|
||||
rm $publicdest -R
|
||||
if [ "$2" = "" ]; then
|
||||
|
||||
if [ -d "$publicdest" ]; then
|
||||
echo remove existing $publicdest
|
||||
rm $publicdest -R
|
||||
fi
|
||||
fi
|
||||
|
||||
echo mkdir $publicdest
|
||||
mkdir $publicdest
|
||||
if [ ! -d "$publicdest" ]; then
|
||||
echo mkdir $publicdest
|
||||
mkdir $publicdest
|
||||
fi
|
||||
|
||||
echo building app.js
|
||||
echo - copy template.js ...
|
||||
cp $src/make-src/template.js $publicdest/app.js
|
||||
if [ "$2" = "" ]||[ "$2" = "app.js" ]; then
|
||||
echo building app.js
|
||||
echo - copy template.js ...
|
||||
cp $src/make-src/template.js $publicdest/app.js
|
||||
|
||||
for filename in $src/app/*.js; do
|
||||
fname=$(basename "$filename")
|
||||
fname="${fname%.*}"
|
||||
echo - adding $fname ...
|
||||
echo require.register\(\"$fname\", function\(exports, require, module\) { >> $publicdest/app.js
|
||||
cat $filename >> $publicdest/app.js
|
||||
echo >> $publicdest/app.js
|
||||
echo }\)\; >> $publicdest/app.js
|
||||
done
|
||||
for filename in $src/app/*.js; do
|
||||
fname=$(basename "$filename")
|
||||
fname="${fname%.*}"
|
||||
echo - adding $fname ...
|
||||
echo require.register\(\"$fname\", function\(exports, require, module\) { >> $publicdest/app.js
|
||||
cat $filename >> $publicdest/app.js
|
||||
echo >> $publicdest/app.js
|
||||
echo }\)\; >> $publicdest/app.js
|
||||
done
|
||||
fi
|
||||
|
||||
echo building app.css
|
||||
cat $src/app/green-black.scss >> $publicdest/app.css
|
||||
cat $src/make-src/main.css >> $publicdest/app.css
|
||||
cat $src/make-src/chat.css >> $publicdest/app.css
|
||||
if [ "$2" = "" ]||[ "$2" = "app.css" ]; then
|
||||
echo building app.css
|
||||
cat $src/app/green-black.scss >> $publicdest/app.css
|
||||
cat $src/make-src/main.css >> $publicdest/app.css
|
||||
cat $src/make-src/chat.css >> $publicdest/app.css
|
||||
fi
|
||||
|
||||
echo copy index.html
|
||||
cp $src/app/assets/index.html $publicdest/index.html
|
||||
if [ "$2" = "" ]||[ "$2" = "index.html" ]; then
|
||||
echo copy index.html
|
||||
cp $src/app/assets/index.html $publicdest/index.html
|
||||
fi
|
||||
|
||||
if [ "$2" != "" ]&&[ "$3" != "" ]; then
|
||||
if [ ! -d "$3/webui" ]; then
|
||||
echo mkdir $3/webui
|
||||
mkdir $3/webui
|
||||
fi
|
||||
echo copy $2 nach $3/webui/$2
|
||||
cp $publicdest/$2 $3/webui/$2
|
||||
fi
|
||||
echo build.sh complete
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue