2018-06-06 20:02:00 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
cd $(dirname $0)/..
|
|
|
|
|
2018-08-06 04:15:57 +00:00
|
|
|
if [ -d "rice-box.go" ]; then
|
|
|
|
rm -rf rice-box.go
|
|
|
|
fi
|
|
|
|
|
2018-06-06 20:02:00 +00:00
|
|
|
if [ "$USE_DOCKER" != "" ]; then
|
|
|
|
if [ -d "frontend/dist" ]; then
|
|
|
|
rm -rf frontend/dist
|
|
|
|
fi;
|
2018-04-18 15:27:28 +00:00
|
|
|
|
|
|
|
if [ "$WDIR" = "" ]; then
|
|
|
|
WDIR="/go/src/github.com/filebrowser/filebrowser"
|
|
|
|
fi;
|
2018-06-06 20:02:00 +00:00
|
|
|
|
|
|
|
$(command -v winpty) docker run -it \
|
|
|
|
--name filebrowser-tmp \
|
|
|
|
-v /$(pwd):/src:z \
|
2018-04-18 15:27:28 +00:00
|
|
|
-w /${WDIR} \
|
2018-06-06 20:02:00 +00:00
|
|
|
filebrowser/dev \
|
|
|
|
sh -c "\
|
2018-04-18 15:27:28 +00:00
|
|
|
cp -r //src/* /$WDIR && \
|
2018-06-06 20:02:00 +00:00
|
|
|
cd build && \
|
|
|
|
dos2unix build_assets.sh && \
|
|
|
|
dos2unix build.sh && \
|
|
|
|
./build_assets.sh && \
|
|
|
|
./build.sh \
|
|
|
|
"
|
|
|
|
exitcode=$?
|
|
|
|
|
|
|
|
if [ $exitcode -eq 0 ]; then
|
|
|
|
for d in "dist/" "node_modules/"; do
|
2018-04-18 15:27:28 +00:00
|
|
|
docker cp filebrowser-tmp:/$WDIR/frontend/$d frontend
|
2018-06-06 20:02:00 +00:00
|
|
|
done
|
|
|
|
for d in "vendor/" "rice-box.go" "filebrowser"; do
|
2018-04-18 15:27:28 +00:00
|
|
|
docker cp filebrowser-tmp:/$WDIR/$d ./
|
2018-06-06 20:02:00 +00:00
|
|
|
done
|
|
|
|
fi
|
|
|
|
docker rm -f filebrowser-tmp
|
|
|
|
else
|
|
|
|
./build/build_assets.sh
|
|
|
|
./build/build.sh
|
|
|
|
fi
|