add test post flag

This commit is contained in:
xenia 2020-09-01 03:49:12 -04:00
父節點 6e399e6c43
當前提交 5a7730e095
共有 1 個檔案被更改,包括 15 行新增4 行删除

查看文件

@ -68,8 +68,19 @@
(path->string (path->complete-path (find-system-path 'run-file)))))
(parameterize ([current-config (config-from-file "config.rktd")])
(run-bot)
(schedule-next)
(define selftest (make-parameter #f))
(void))
(command-line
#:program "awoobot"
#:once-each
[("-t" "--test") "Send a test post" (selftest #t)]
#:args ()
(parameterize ([current-config (config-from-file "config.rktd")])
(if (selftest)
(begin
(displayln "testing config")
(send-toot/retry-on-err (make-toot "test post pls ignore,")))
(begin
(run-bot)
(schedule-next)))
(void)))