From c1ee761a65ff550c5f69851d90a23aae465f92a3 Mon Sep 17 00:00:00 2001 From: Aki Kareha Date: Sat, 22 Feb 2025 09:14:17 +0900 Subject: [PATCH] use shfmt --- format | 2 ++ update | 8 ++++---- 2 files changed, 6 insertions(+), 4 deletions(-) create mode 100755 format diff --git a/format b/format new file mode 100755 index 0000000..edab75d --- /dev/null +++ b/format @@ -0,0 +1,2 @@ +#!/bin/sh +shfmt -i 2 -ci -w update diff --git a/update b/update index ddb71d0..000a511 100755 --- a/update +++ b/update @@ -12,20 +12,20 @@ EXIT_SUCCESS=0 EXIT_FAILURE=1 # Verify the required runtime environment -if ! command -v curl > /dev/null; then +if ! command -v curl >/dev/null; then echo "This script requires \"curl\" to be installed. Please install it and try again." exit $EXIT_FAILURE fi -if ! command -v nkf > /dev/null; then +if ! command -v nkf >/dev/null; then echo "This script requires \"nkf\" to be installed. Please install it and try again." exit $EXIT_FAILURE fi # Run curl -sS -L -o $TMP_CSV_FILE $CSV_URL -if ! diff -q $RAW_CSV_FILE $TMP_CSV_FILE > /dev/null 2>&1; then +if ! diff -q $RAW_CSV_FILE $TMP_CSV_FILE >/dev/null 2>&1; then mv $TMP_CSV_FILE $RAW_CSV_FILE - nkf -w $RAW_CSV_FILE > $CSV_FILE + nkf -w $RAW_CSV_FILE >$CSV_FILE else rm $TMP_CSV_FILE fi