Skip to content

Commit 1728964

Browse files
committed
Apply changes made by shfmt linter
1 parent 0a7e4dd commit 1728964

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

src/entrypoint.sh

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ done
3636
handle_sigterm() {
3737
log_warn "TERM signal received. Shutting down server."
3838
# Only attempt to terminate if the child process is still running
39-
if kill -0 "$child_pid" 2>/dev/null; then
39+
if kill -0 "$child_pid" 2> /dev/null; then
4040
log_debug "Sending TERM signal to child pid: ${child_pid}"
41-
kill -TERM "$child_pid" 2>/dev/null
41+
kill -TERM "$child_pid" 2> /dev/null
4242
else
4343
log_warn "Child pid: ${child_pid} exited before we could sent TERM signal."
4444
fi
@@ -58,19 +58,19 @@ log_debug "Mount info for ${DATA_DIR}: ${mount_info}"
5858
permissions_test_file="${DATA_DIR}/.container-permissions-test.txt"
5959
permission_test_failed=0
6060
log_debug "Testing permissions on ${permissions_test_file}"
61-
if ! touch "${permissions_test_file}" 2>/dev/null; then
61+
if ! touch "${permissions_test_file}" 2> /dev/null; then
6262
log_error "Volume write test failed."
6363
permission_test_failed=1
6464
else
6565
log_debug "Volume write test succeeded."
6666
fi
67-
if ! cat "${permissions_test_file}" >/dev/null 2>&1; then
67+
if ! cat "${permissions_test_file}" > /dev/null 2>&1; then
6868
log_error "Volume read test failed."
6969
permission_test_failed=1
7070
else
7171
log_debug "Volume read test succeeded."
7272
fi
73-
if ! rm -f "${permissions_test_file}" 2>/dev/null; then
73+
if ! rm -f "${permissions_test_file}" 2> /dev/null; then
7474
log_error "Volume delete test failed."
7575
permission_test_failed=1
7676
else
@@ -181,7 +181,7 @@ if [ $install_required = true ]; then
181181
log "Using CONTAINER_CACHE: ${CONTAINER_CACHE}"
182182
mkdir -p "${CONTAINER_CACHE}"
183183
# Create a cache marker file in the cache directory.
184-
cat <<END_OF_LINE >"${CONTAINER_CACHE}/CACHEDIR.TAG"
184+
cat << END_OF_LINE > "${CONTAINER_CACHE}/CACHEDIR.TAG"
185185
Signature: $(printf ".IsCacheDirectory" | md5sum | cut -d ' ' -f 1)
186186
# This file is a cache directory tag created by the felddy/foundryvtt container
187187
# https://github.com/felddy/foundryvtt-docker
@@ -205,9 +205,9 @@ END_OF_LINE
205205
curl ${CONTAINER_VERBOSE+--verbose} --fail --location \
206206
--user-agent "${curl_user_agent}" \
207207
--time-cond "${release_filename}" \
208-
--output "${downloading_filename}" "${presigned_url}" 2>&1 |
209-
tr "\r" "\n" |
210-
sed --unbuffered '/^Warning: .* date/d'
208+
--output "${downloading_filename}" "${presigned_url}" 2>&1 \
209+
| tr "\r" "\n" \
210+
| sed --unbuffered '/^Warning: .* date/d'
211211
curl_exit_code=$?
212212
set -e
213213

@@ -225,7 +225,7 @@ END_OF_LINE
225225
else
226226
# Download succeeded so rename the file to the final name.
227227
# If we had a cache hit, the file is already renamed.
228-
mv "${downloading_filename}" "${release_filename}" >/dev/null 2>&1 || true
228+
mv "${downloading_filename}" "${release_filename}" > /dev/null 2>&1 || true
229229
fi
230230
fi
231231

@@ -275,7 +275,7 @@ END_OF_LINE
275275
log "Preserving release archive file in cache."
276276
# Check if CONTAINER_CACHE_SIZE is set and if so, ensure it's greater than 0
277277
if [[ -n "${CONTAINER_CACHE_SIZE:-}" ]]; then
278-
if ! [[ "${CONTAINER_CACHE_SIZE}" -gt 0 ]] 2>/dev/null; then
278+
if ! [[ "${CONTAINER_CACHE_SIZE}" -gt 0 ]] 2> /dev/null; then
279279
log_error "If set, CONTAINER_CACHE_SIZE must be 1 or greater. Found: ${CONTAINER_CACHE_SIZE}"
280280
exit 1
281281
fi
@@ -286,9 +286,9 @@ END_OF_LINE
286286
cache_files_removed_count=0
287287

288288
# Store the list of cache files to remove
289-
file_list=$(find "${CONTAINER_CACHE}" -maxdepth 1 -name 'foundryvtt-*.zip' |
290-
sort -Vr |
291-
awk -v keep="${CONTAINER_CACHE_SIZE}" 'NR > keep')
289+
file_list=$(find "${CONTAINER_CACHE}" -maxdepth 1 -name 'foundryvtt-*.zip' \
290+
| sort -Vr \
291+
| awk -v keep="${CONTAINER_CACHE_SIZE}" 'NR > keep')
292292

293293
# Iterate over the file list
294294
if [ -n "$file_list" ]; then
@@ -359,7 +359,7 @@ if [ ! -f "${LICENSE_FILE}" ]; then
359359
set -o nounset
360360
log "Applying license key passed via FOUNDRY_LICENSE_KEY."
361361
# FOUNDRY_LICENSE_KEY is long enough to be a key
362-
echo "{ \"license\": \"${FOUNDRY_LICENSE_KEY}\" }" | tr -d '-' >"${LICENSE_FILE}"
362+
echo "{ \"license\": \"${FOUNDRY_LICENSE_KEY}\" }" | tr -d '-' > "${LICENSE_FILE}"
363363
elif [ -f ${cookiejar_file} ]; then
364364
log "Attempting to fetch license key from authenticated account."
365365
if [[ "${FOUNDRY_LICENSE_KEY:-}" ]]; then
@@ -376,7 +376,7 @@ if [ ! -f "${LICENSE_FILE}" ]; then
376376
--user-agent="${node_user_agent}" \
377377
"${cookiejar_file}")
378378
fi
379-
echo "{ \"license\": \"${fetched_license_key}\" }" >"${LICENSE_FILE}"
379+
echo "{ \"license\": \"${fetched_license_key}\" }" > "${LICENSE_FILE}"
380380
else
381381
log_warn "Unable to apply a license key since neither a license key nor credentials were provided. The license key will need to be entered in the browser."
382382
fi

0 commit comments

Comments
 (0)