fix sftpgo.sh when source directory already exists
This commit is contained in:
parent
6f9a7ffdaf
commit
8782bfcfb7
|
@ -1,17 +1,22 @@
|
||||||
#!/usr/bin/bash
|
#!/usr/bin/bash
|
||||||
source /etc/os-release
|
source /etc/os-release
|
||||||
|
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
export GO=/usr/bin/go
|
export GO=/usr/bin/go
|
||||||
if [[ $ID = "debian" ]]; then
|
if [[ $ID = "debian" ]]; then
|
||||||
export GO=/usr/lib/go-1.19/bin/go
|
export GO=/usr/lib/go-1.19/bin/go
|
||||||
fi
|
fi
|
||||||
|
|
||||||
git clone https://github.com/drakkan/sftpgo sftpgo-src
|
if [[ -d "sftpgo" ]]; then
|
||||||
|
git clone https://github.com/drakkan/sftpgo sftpgo-src
|
||||||
|
fi
|
||||||
cd sftpgo-src
|
cd sftpgo-src
|
||||||
|
git pull origin HEAD
|
||||||
git checkout $(git tag | tail -n 1)
|
git checkout $(git tag | tail -n 1)
|
||||||
cp -r openapi ./internal/bundle/openapi
|
cp -r openapi ./internal/bundle/openapi
|
||||||
cp -r templates ./internal/bundle/templates
|
cp -r templates ./internal/bundle/templates
|
||||||
cp -r static ./internal/bundle/static
|
cp -r static ./internal/bundle/static
|
||||||
$GO build -tags nogcs,nos3,noazblob,nobolt,nomysql,nopgsql,nosqlite,noportable,nometrics,bundle -o /usr/local/bin/sftpgo
|
$GO build -tags nogcs,nos3,noazblob,nobolt,nomysql,nopgsql,nosqlite,noportable,nometrics,bundle -o sftpgo
|
||||||
|
mv sftpgo /usr/local/bin/
|
||||||
strip /usr/local/bin/sftpgo
|
strip /usr/local/bin/sftpgo
|
||||||
|
|
Loading…
Reference in New Issue