mirror of
https://github.com/filebrowser/filebrowser.git
synced 2025-05-08 11:22:10 +00:00

- Use cobra in order to provide subcommands `serve` and `db`. - Subdir `cmd` is removed. - Subdir `cli` is created, which is a standard cobra structure. - Sources related to the core are moved to subdir `lib`. - #497 and #504 are merged. - Deprecated flags are added. See https://github.com/filebrowser/filebrowser/pull/497#discussion_r209428120. - [`viper.BindPFlags`](https://godoc.org/github.com/spf13/viper#BindPFlags) is used in order to reduce the verbosity in `serve.go`. Former-commit-id: 4b37ad82e91e01f7718cd389469814674bdf7032 [formerly c84d7fcf9c362b2aa1f9e5b57196152f53835e61] [formerly 2fef43c0382f3cc7d13e0297ccb467e38fac6982 [formerly 69a3f853bd2821d2c52a435277aaac68a468d39b]] Former-commit-id: 2f7dc1b8ee6735382cedae2053f40c546c21de45 [formerly b438417178b47ad5f7caf9cb728f4a5011a09f5e] Former-commit-id: 07bc58ab2e1ab10c30be8d0a5e760288bfc4d4dc
53 lines
1.1 KiB
Bash
Executable File
53 lines
1.1 KiB
Bash
Executable File
#!/bin/sh
|
|
|
|
cd $(dirname $0)/..
|
|
|
|
if [ -d lib/"rice-box.go" ]; then
|
|
rm -rf lib/rice-box.go
|
|
fi
|
|
|
|
if [ "$USE_DOCKER" != "" ]; then
|
|
if [ -d "frontend/dist" ]; then
|
|
rm -rf frontend/dist
|
|
fi;
|
|
|
|
if [ "$WDIR" = "" ]; then
|
|
WDIR="/go/src/github.com/filebrowser/filebrowser"
|
|
fi;
|
|
|
|
if [ "$(command -v git)" != "" ]; then
|
|
COMMIT_SHA="$(git rev-parse HEAD | cut -c1-8)"
|
|
else
|
|
COMMIT_SHA="untracked"
|
|
fi
|
|
|
|
$(command -v winpty) docker run -it \
|
|
--name filebrowser-tmp \
|
|
-v /$(pwd):/src:z \
|
|
-w /${WDIR} \
|
|
-e COMMIT_SHA=$COMMIT_SHA \
|
|
filebrowser/dev \
|
|
sh -c "\
|
|
cp -r //src/* /$WDIR && \
|
|
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
|
|
docker cp filebrowser-tmp:/$WDIR/frontend/$d frontend
|
|
done
|
|
docker cp filebrowser-tmp:/$WDIR/cli/filebrowser ./filebrowser
|
|
docker cp filebrowser-tmp:/$WDIR/lib/rice-box.go ./lib/rice-box.go
|
|
fi
|
|
docker rm -f filebrowser-tmp
|
|
else
|
|
set -e
|
|
./build/build_assets.sh
|
|
./build/build.sh
|
|
fi
|