From 1e9467aa2056187b8333522ef4f526115325dcd8 Mon Sep 17 00:00:00 2001 From: myoshizumi Date: Wed, 11 Feb 2026 13:32:41 +0900 Subject: [PATCH 1/2] Add trap to ensure temp file cleanup in SRI script --- calc_sri_fix.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/calc_sri_fix.sh b/calc_sri_fix.sh index e71fa62f..e5e2cbd0 100755 --- a/calc_sri_fix.sh +++ b/calc_sri_fix.sh @@ -5,18 +5,17 @@ set -euo pipefail calculate_sri() { url="$1" temp_file=$(mktemp) + trap 'rm -f "$temp_file"' RETURN # curl options: -f (fail on HTTP error), -S (show error), -s (silent equivalent), -L (follow redirects) if ! curl -fS -sL "$url" -o "$temp_file"; then echo "Error downloading $url" >&2 - rm -f "$temp_file" return 1 fi # Check for empty response if [ ! -s "$temp_file" ]; then echo "Error: Empty response from $url" >&2 - rm -f "$temp_file" return 1 fi From b4fd9578653daedf0522326dce3e23bf9fa6d551 Mon Sep 17 00:00:00 2001 From: "coderabbitai[bot]" <136622811+coderabbitai[bot]@users.noreply.github.com> Date: Wed, 11 Feb 2026 06:44:06 +0000 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=93=9D=20Add=20docstrings=20to=20`dev?= =?UTF-8?q?-from-macmini`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Docstrings generation was requested by @myoshi2891. * https://github.com/myoshi2891/Algorithm-DataStructures-Math-SQL/pull/266#issuecomment-3882629912 The following files were modified: * `calc_sri_fix.sh` --- calc_sri_fix.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) mode change 100755 => 100644 calc_sri_fix.sh diff --git a/calc_sri_fix.sh b/calc_sri_fix.sh old mode 100755 new mode 100644 index e5e2cbd0..cfc47292 --- a/calc_sri_fix.sh +++ b/calc_sri_fix.sh @@ -2,6 +2,7 @@ set -euo pipefail +# calculate_sri downloads the given URL, computes the SHA-384 SRI hash of its content (base64) and echoes a line " sha384-". calculate_sri() { url="$1" temp_file=$(mktemp) @@ -25,4 +26,4 @@ calculate_sri() { } calculate_sri "https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/plugins/line-numbers/prism-line-numbers.min.js" -calculate_sri "https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/plugins/toolbar/prism-toolbar.min.js" +calculate_sri "https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/plugins/toolbar/prism-toolbar.min.js" \ No newline at end of file