mirror of
https://github.com/itzg/docker-minecraft-server.git
synced 2026-02-17 07:03:57 +00:00
New logger with color and specific types. Code cleanup (#3108)
This commit is contained in:
@@ -30,28 +30,28 @@ if [[ "$DATAPACKS" ]]; then
|
||||
if isURL "$i"; then
|
||||
log "Downloading datapack $i ..."
|
||||
if ! get -o "${out_dir}" "$i"; then
|
||||
log "ERROR: failed to download from $i into $out_dir"
|
||||
logError "Failed to download from $i into $out_dir"
|
||||
exit 2
|
||||
fi
|
||||
elif [[ -f "$i" && "$i" =~ .*\.zip ]]; then
|
||||
log "Copying datapack located at $i ..."
|
||||
out_file=$(basename "$i")
|
||||
if ! cp "$i" "${out_dir}/$out_file"; then
|
||||
log "ERROR: failed to copy from $i into $out_dir"
|
||||
logError "Failed to copy from $i into $out_dir"
|
||||
exit 2
|
||||
fi
|
||||
elif [[ -d "$i" ]]; then
|
||||
log "Copying datapacks from $i ..."
|
||||
cp "$i"/*.zip "${out_dir}"
|
||||
else
|
||||
log "ERROR Invalid URL or path given in DATAPACKS: $i"
|
||||
logError "Invalid URL or path given in DATAPACKS: $i"
|
||||
exit 2
|
||||
fi
|
||||
done
|
||||
|
||||
elif [[ "$DATAPACKS_FILE" ]]; then
|
||||
if [ ! -f "$DATAPACKS_FILE" ]; then
|
||||
log "ERROR: given DATAPACKS_FILE file does not exist"
|
||||
logError "Given DATAPACKS_FILE file does not exist"
|
||||
exit 2
|
||||
fi
|
||||
|
||||
@@ -71,7 +71,7 @@ elif [[ "$DATAPACKS_FILE" ]]; then
|
||||
fi
|
||||
|
||||
if ! get "${args[@]}" ; then
|
||||
log "ERROR: failed to retrieve one or more datapacks"
|
||||
logError "Failed to retrieve one or more datapacks"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user