From 8be42bacdaaafd3fe9faec313d87b1bdc120357b Mon Sep 17 00:00:00 2001 From: Toshihiko SHIMOKAWA Date: Fri, 26 Jun 2026 10:21:06 +0900 Subject: [PATCH] Add neutral SUBMIT_OPENER hook to the submit target The 'make s' submit step now delegates to an executable $SUBMIT_OPENER (default ~/.local/bin/submit-opener) when one is present, and otherwise opens the submit page exactly as before. This lets an individual swap in a personal opener without editing this shared file. Also gitignore .local/bin/ where such an opener is installed. --- .gitignore | 1 + lib/.support/makefile | 13 +++++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index d5abfec..51a4195 100644 --- a/.gitignore +++ b/.gitignore @@ -5,4 +5,5 @@ lib/* atcoder-cli-nodejs/*/makefile atcoder-cli-nodejs/session.json .local/share/ +.local/bin/ erl_crash.dump diff --git a/lib/.support/makefile b/lib/.support/makefile index 94006a4..0c9bde3 100644 --- a/lib/.support/makefile +++ b/lib/.support/makefile @@ -252,13 +252,22 @@ tf: $(TARGET) test/sample-1.in SRC_FILE ?= $(SRC) +# 提出ページを開く処理は、実行可能な個人用 opener が配置されていればそちらに +# 委譲する。共有ファイルである本 makefile を編集せずに「開き方」を各自で +# 差し替えられるようにするための拡張点。未配置なら従来どおり $(OPEN) で開く。 +SUBMIT_OPENER ?= $(HOME)/.local/bin/submit-opener + s: $(TARGET) @test -f "$(SRC_FILE)" || { echo "$(SRC_FILE) が存在しません" >&2; exit 1; } @payload=$$(base64 < "$(SRC_FILE)" | tr -d '\n\r'); printf '\033]52;c;%s\033\134' "$$payload" @echo "$(SRC_FILE) をクリップボードにコピーしました" @submit_url=$$(printf '%s\n' "$(TASK_URL)" | sed 's|/tasks/\(.*\)|/submit?taskScreenName=\1|'); \ - $(OPEN) "$$submit_url" - @echo "提出ページを開きました。Ctrl+V (Cmd+V) でコードを貼り付けて提出してください" + if [ -x "$(SUBMIT_OPENER)" ]; then \ + "$(SUBMIT_OPENER)" "$$submit_url" "$(SRC_FILE)"; \ + else \ + $(OPEN) "$$submit_url"; \ + echo "提出ページを開きました。Ctrl+V (Cmd+V) でコードを貼り付けて提出してください"; \ + fi run: $(TARGET) $(RUN_TEST)