New logger with color and specific types. Code cleanup (#3108)

This commit is contained in:
Tristan
2024-10-22 23:04:38 +02:00
committed by GitHub
parent a356c6810e
commit bef7b4719f
38 changed files with 424 additions and 428 deletions

View File

@@ -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