您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

14 行
474B

  1. include .env
  2. export
  3. PYTHONPATH := .
  4. FILE := $(shell find . -path "./y????/p??.py" -type f | xargs ls -rt | tail -n 1)
  5. YEAR := $(shell echo ${FILE} | sed 's/[^0-9]/ /g' | cut -d' ' -f4)
  6. DAY := $(shell echo ${FILE} | sed 's/[^0-9]/ /g' | cut -d' ' -f6 | bc)
  7. URL := https://adventofcode.com/${YEAR}/day/${DAY}/input
  8. DATA := $(shell echo ${FILE} | sed s/.py/.dat/)
  9. main:
  10. @test -f ${DATA} || curl -s -b "session=${SESSION}" ${URL} > ${DATA}
  11. @cat $(DATA) | python3 -u $(FILE)