fix(apps/scripts): Add quotes for directory paths containing empty spaces (#3716)

This commit is contained in:
Patrick Lewis
2020-12-23 13:17:45 -08:00
committed by GitHub
parent d6abb82055
commit bc51fbf3f4
3 changed files with 28 additions and 28 deletions

View File

@@ -15,9 +15,9 @@ fi
for entry in "$AC_PATH_MODULES/"*/include.sh
do
if [ -e $entry ]; then
source $entry
if [ -e "$entry" ]; then
source "$entry"
fi
done
ACORE_VERSION=$("$AC_PATH_DEPS/jsonpath/JSONPath.sh" -f $AC_PATH_ROOT/acore.json -b '$.version')
ACORE_VERSION=$("$AC_PATH_DEPS/jsonpath/JSONPath.sh" -f "$AC_PATH_ROOT/acore.json" -b '$.version')

View File

@@ -145,7 +145,7 @@ function dbasm_assemble() {
shopt -s globstar
if [ $with_base = true ]; then
echo "" > $OUTPUT_FOLDER$database$suffix_base".sql"
echo "" > "$OUTPUT_FOLDER$database$suffix_base.sql"
if [ ! ${#base[@]} -eq 0 ]; then
@@ -154,11 +154,11 @@ function dbasm_assemble() {
for d in "${base[@]}"
do
echo "Searching on $d ..."
if [ ! -z $d ]; then
if [ ! -z "$d" ]; then
for entry in "$d"/**/*.sql
do
if [[ -e $entry ]]; then
cat "$entry" >> $OUTPUT_FOLDER$database$suffix_base".sql"
cat "$entry" >> "$OUTPUT_FOLDER$database$suffix_base.sql"
fi
done
fi
@@ -167,9 +167,9 @@ function dbasm_assemble() {
fi
if [ $with_updates = true ]; then
updFile=$OUTPUT_FOLDER$database$suffix_upd".sql"
updFile="$OUTPUT_FOLDER$database$suffix_upd.sql"
echo "" > $updFile
echo "" > "$updFile"
if [ ! ${#updates[@]} -eq 0 ]; then
echo "Generating $OUTPUT_FOLDER$database$suffix_upd ..."
@@ -177,15 +177,15 @@ function dbasm_assemble() {
for d in "${updates[@]}"
do
echo "Searching on $d ..."
if [ ! -z $d ]; then
if [ ! -z "$d" ]; then
for entry in "$d"/**/*.sql
do
if [[ ! -e $entry ]]; then
continue
fi
echo "-- $file" >> $updFile
cat "$entry" >> $updFile
echo "-- $file" >> "$updFile"
cat "$entry" >> "$updFile"
done
fi
done
@@ -193,9 +193,9 @@ function dbasm_assemble() {
fi
if [ $with_custom = true ]; then
custFile=$OUTPUT_FOLDER$database$suffix_custom".sql"
custFile="$OUTPUT_FOLDER$database$suffix_custom.sql"
echo "" > $custFile
echo "" > "$custFile"
if [ ! ${#custom[@]} -eq 0 ]; then
echo "Generating $OUTPUT_FOLDER$database$suffix_custom ..."
@@ -203,15 +203,15 @@ function dbasm_assemble() {
for d in "${custom[@]}"
do
echo "Searching on $d ..."
if [ ! -z $d ]; then
if [ ! -z "$d" ]; then
for entry in "$d"/**/*.sql
do
if [[ ! -e $entry ]]; then
continue
fi
echo "-- $file" >> $custFile
cat "$entry" >> $custFile
echo "-- $file" >> "$custFile"
cat "$entry" >> "$custFile"
done
fi
done

24
conf/dist/config.sh vendored
View File

@@ -98,44 +98,44 @@ BACKUP_FOLDER="$AC_PATH_ROOT/env/dist/sql/backup/"
# FULL DB
DB_AUTH_PATHS=(
$SRCPATH"/data/sql/base/db_auth/"
"$SRCPATH/data/sql/base/db_auth/"
)
DB_CHARACTERS_PATHS=(
$SRCPATH"/data/sql/base/db_characters"
"$SRCPATH/data/sql/base/db_characters"
)
DB_WORLD_PATHS=(
$SRCPATH"/data/sql/base/db_world/"
"$SRCPATH/data/sql/base/db_world/"
)
# UPDATES
DB_AUTH_UPDATES_PATHS=(
$SRCPATH"/data/sql/updates/db_auth/"
$SRCPATH"/data/sql/updates/pending_db_auth/"
"$SRCPATH/data/sql/updates/db_auth/"
"$SRCPATH/data/sql/updates/pending_db_auth/"
)
DB_CHARACTERS_UPDATES_PATHS=(
$SRCPATH"/data/sql/updates/db_characters/"
$SRCPATH"/data/sql/updates/pending_db_characters/"
"$SRCPATH/data/sql/updates/db_characters/"
"$SRCPATH/data/sql/updates/pending_db_characters/"
)
DB_WORLD_UPDATES_PATHS=(
$SRCPATH"/data/sql/updates/db_world/"
$SRCPATH"/data/sql/updates/pending_db_world/"
"$SRCPATH/data/sql/updates/db_world/"
"$SRCPATH/data/sql/updates/pending_db_world/"
)
# CUSTOM
DB_AUTH_CUSTOM_PATHS=(
$SRCPATH"/data/sql/custom/db_auth/"
"$SRCPATH/data/sql/custom/db_auth/"
)
DB_CHARACTERS_CUSTOM_PATHS=(
$SRCPATH"/data/sql/custom/db_characters/"
"$SRCPATH/data/sql/custom/db_characters/"
)
DB_WORLD_CUSTOM_PATHS=(
$SRCPATH"/data/sql/custom/db_world/"
"$SRCPATH/data/sql/custom/db_world/"
)
##############################################