-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
make: email target to start server lazily
- Loading branch information
Showing
2 changed files
with
15 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,25 @@ | ||
#!/bin/sh | ||
|
||
set -e | ||
|
||
# Accept a parameter --start-server to start the server before sending the email. | ||
if [ "$1" = "--start-server" ]; then | ||
flox activate -- make webapp & | ||
sleep 10 # Wait for the server to start. | ||
fi | ||
|
||
[email protected] | ||
TOADDRS=$FROMADDR | ||
|
||
tmpdir=$(mktemp -d) | ||
reportfile=$tmpdir/movies.report | ||
|
||
lcli report render --name default > "$reportfile" | ||
flox activate -- lcli report render --name default > "$reportfile" | ||
mailsend-go -from $FROMADDR -t $TOADDRS -sub "Movies for $(date '+%Y-%m-%d')" \ | ||
-use gmail auth -user $FROMADDR -pass "$(pass priv/google.com-mutt)" \ | ||
body -file "$reportfile" | ||
|
||
rm -r "$tmpdir" | ||
|
||
kill %1 | ||
exit |