fix helper script
This commit is contained in:
parent
f544aef439
commit
67f97309f6
@ -2,16 +2,21 @@
|
|||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
defaultsdir="$(cd "$(dirname "$0")" && pwd)/../.defaults"
|
||||||
|
|
||||||
# get sections
|
# get sections
|
||||||
sections=$(curl -L https://raw.githubusercontent.com/go-gitea/gitea/master/custom/conf/app.ini.sample 2>/dev/null | grep '^\[.*\]' | tr '\n' ' '|tr -d '[' | tr -d ']' )
|
sections=$(
|
||||||
|
curl -L https://raw.githubusercontent.com/go-gitea/gitea/master/custom/conf/app.ini.sample 2>/dev/null \
|
||||||
|
| grep '^\[.*\]' | tr '\n' ' '|tr -d '[' | tr -d ']'
|
||||||
|
)
|
||||||
|
|
||||||
for x in $sections; do
|
for x in $sections; do
|
||||||
# to upper and remove dot
|
# to upper and remove dot
|
||||||
y=$(echo -n "$x" | tr '[:lower:]' '[:upper:]' | tr '.' '_' | tr '-' '_' )
|
y=$(echo -n "$x" | tr '[:lower:]' '[:upper:]' | tr '.' '_' | tr '-' '_' )
|
||||||
# skip existing files
|
# skip existing files
|
||||||
[ -f "$PWD/$x.sh" ] && continue
|
[ -f "$defaultsdir/$x.sh" ] && continue
|
||||||
# generate empty section file
|
# generate empty section file
|
||||||
cat>"$PWD/$x.sh" << EOB
|
cat>"$defaultsdir/$x.sh" << EOB
|
||||||
# $x
|
# $x
|
||||||
[ -z "\${A_DEFAULT_SETTINGS_${y}}" ] \\
|
[ -z "\${A_DEFAULT_SETTINGS_${y}}" ] \\
|
||||||
&& A_DEFAULT_SETTINGS_${y}=\$(cat << EOF
|
&& A_DEFAULT_SETTINGS_${y}=\$(cat << EOF
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user