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)