- 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`.
21 lines
411 B
Bash
Executable File
21 lines
411 B
Bash
Executable File
#!/bin/sh
|
|
|
|
set -e
|
|
|
|
cd $(dirname $0)/../cli
|
|
|
|
go get -v ./...
|
|
|
|
if [ "$COMMIT_SHA" != "" ]; then
|
|
echo "Set version to ($COMMIT_SHA)"
|
|
sed -i.bak "s|(untracked)|($COMMIT_SHA)|g" ../lib/filebrowser.go
|
|
fi
|
|
|
|
echo "Build cmd/filebrowser"
|
|
CGO_ENABLED=0 go build -a -o filebrowser
|
|
|
|
if [ "$COMMIT_SHA" != "" ]; then
|
|
echo "Reset version to (untracked)"
|
|
sed -i "s|($COMMIT_SHA)|(untracked)|g" ../lib/filebrowser.go
|
|
fi
|