|
|
@@ -14,6 +14,12 @@ update_modules() {
|
|
|
|
|
|
update_config() {
|
|
|
KOFI_TOKEN=$(grep "^KOFI_TOKEN" instance/config.py | cut -d'=' -f2 | cut -d'#' -f1 | tr -d '[:space:]') # Get the value of KOFI_TOKEN
|
|
|
+ if [ "$KOFI_TOKEN" = "False" ]; then # So bash doesn't blank the variable in kofi.py if it's False
|
|
|
+ KOFI_TOKEN="False"
|
|
|
+ fi
|
|
|
+ if [ -z "$KOFI_INTEGRATION" ]; then # So bash doesn't blank the variable in kofi.py if it's empty.
|
|
|
+ KOFI_INTEGRATION="''"
|
|
|
+ fi
|
|
|
KOFI_INTEGRATION=$(grep "^KOFI_INTEGRATION" instance/config.py | cut -d'=' -f2 | cut -d'#' -f1 | tr -d '[:space:]') # Get the value of KOFI_INTEGRATION
|
|
|
sed -i "s/}/, \'token\': ${KOFI_TOKEN}, \'integration\': ${KOFI_INTEGRATION}}/" instance/kofi.py # Append those values to kofi.py
|
|
|
sed -i "/^KOFI_TOKEN/d" instance/config.py # Delete KOFI_TOKEN line from config.py
|