13d4b6ab6f9c default tip
Clean up a bit
author | Steve Losh <steve@stevelosh.com> |
---|---|
date | Thu, 12 Jun 2025 16:09:29 -0400 |
parents | da9138afa986 |
children | (none) |
branches/tags | default tip |
files | src/main.lisp |
Changes
--- a/src/main.lisp Thu Jun 12 16:07:13 2025 -0400 +++ b/src/main.lisp Thu Jun 12 16:09:29 2025 -0400 @@ -1,12 +1,10 @@ (in-package :planner) ;;;; Config ------------------------------------------------------------------- -(defparameter *credentials-path* - "/") - (defvar *smtp-api-token* nil) (defvar *smtp-user-name* nil) (defvar *zip-code* nil) + (defparameter *from-address* "plan@stevelosh.com") (defparameter *display-name* "Plan") (defparameter *to-address* "steve@stevelosh.com") @@ -33,6 +31,7 @@ (assert (not (null *smtp-user-name*)) () "smtp-user-name not configured in any of ~{~A~^ ~}" all-config-paths) (assert (not (null *smtp-api-token*)) () "smtp-api-token not configured in any of ~{~A~^ ~}" all-config-paths))) + ;;;; Date --------------------------------------------------------------------- (defun date-iso () (local-time:format-timestring @@ -44,10 +43,12 @@ nil (local-time:now) :format '(:long-weekday ", " :long-month " " :day ", " :year))) + ;;;; Weather ------------------------------------------------------------------ (defun weather () (sh `("weather" "--hours" "20" ,*zip-code*) :result-type 'string)) + ;;;; Main --------------------------------------------------------------------- (defun build-subject () (format nil "[plan/~A] Plan for ~A" (date-iso) (date-human))) @@ -94,14 +95,14 @@ (defun run (&key (dry-run t)) (load-config) - (multiple-value-bind (subject content) - (build-email) + (multiple-value-bind (subject content) (build-email) (if dry-run (print-email subject content) (send-email subject content)) (values))) -;;;; Command Line ------------------------------------------------------------- + +;;;; UI ----------------------------------------------------------------------- (adopt:define-string *documentation* "Planner sends planning emails.")