gracefully handle unavailable git in script/server
This commit is contained in:
parent
66911801f7
commit
63b667bbef
2 changed files with 12 additions and 3 deletions
|
|
@ -7,6 +7,7 @@
|
||||||
## Bug fixes
|
## Bug fixes
|
||||||
|
|
||||||
* Don't use Pathname early to circumvent some rare initialization errors [#3816](https://github.com/diaspora/diaspora/issues/3816)
|
* Don't use Pathname early to circumvent some rare initialization errors [#3816](https://github.com/diaspora/diaspora/issues/3816)
|
||||||
|
* Don't error out in script/server if git is unavailable.
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -103,13 +103,21 @@ fi
|
||||||
# Force AGPL
|
# Force AGPL
|
||||||
if [ -w "public" -a ! -e "public/source.tar.gz" ]
|
if [ -w "public" -a ! -e "public/source.tar.gz" ]
|
||||||
then
|
then
|
||||||
branch=$(git branch | awk '/^[*]/ {print $2}')
|
if command -v git > /dev/null 2>&1 && git rev-parse --is-inside-work-tree > /dev/null 2>&1
|
||||||
tar czf public/source.tar.gz $(git ls-tree -r $branch | awk '{print $4}')
|
then
|
||||||
|
branch=$(git branch | awk '/^[*]/ {print $2}')
|
||||||
|
tar czf public/source.tar.gz $(git ls-tree -r $branch | awk '{print $4}')
|
||||||
|
else
|
||||||
|
fatal <<MSG
|
||||||
|
Can't generate public/source.tar.gz for you. Please tar up a copy of
|
||||||
|
your Diaspora installtion and place it there.
|
||||||
|
MSG
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -e "public/source.tar.gz" ]
|
if [ ! -e "public/source.tar.gz" ]
|
||||||
then
|
then
|
||||||
fatal "Can't find, or even create, public/source.tar.gz."
|
fatal "Can't find public/source.tar.gz"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Check if assets are precompiled
|
# Check if assets are precompiled
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue