Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## [0.2.1] - 2026-10-16

- `digest --dry-run` without `--email` prints the digest instead of failing: there is nothing to send.

## [0.2.0] - 2026-10-16

- `digest` builds a digest of popular, discussed, tag, search, For You or bookmarked posts, and prints it as Markdown, text or HTML.
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@devopsdaily/dailydev-cli",
"version": "0.2.0",
"version": "0.2.1",
"description": "Read daily.dev from your terminal: your feed, popular posts, search, comments and bookmarks, with --json for scripts and agents. Unofficial.",
"type": "module",
"bin": {
Expand Down
5 changes: 2 additions & 3 deletions src/digest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,8 @@ function readDigest(opts: Opts, args: string[], env: Record<string, string | und

const emails = Array.isArray(opts.email) ? (opts.email as string[]) : typeof opts.email === "string" ? [opts.email] : undefined;
if (!emails) {
for (const name of ["from", "dry-run"]) {
if (opts[name] !== undefined) return fail(`--${name} is only used with --email.`);
}
// Without --email nothing is sent anyway, so --dry-run just prints the digest.
if (opts.from !== undefined) return fail("--from is only used with --email.");
// With --schedule, --json is for the schedule and --format for the scheduled command.
if (opts.format !== undefined && opts.json && !opts.schedule) return fail("Give --format or --json, not both.");
return { plan };
Expand Down
2 changes: 1 addition & 1 deletion src/version.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
// Kept in step with package.json by the release check.
export const VERSION = "0.2.0";
export const VERSION = "0.2.1";
10 changes: 9 additions & 1 deletion test/digest.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,15 @@ describe("digest --email", () => {
expect(h.out() + h.err()).not.toMatch(/smtpfa|SMTPFAST/i);
});

it("prints the digest for --dry-run without --email, since there is nothing to send", async () => {
const h = harness();
const plain = harness();
expect(await h.exec(["digest", "--tags", "kubernetes", "--dry-run"])).toBe(0);
expect(await plain.exec(["digest", "--tags", "kubernetes"])).toBe(0);
expect(h.out()).toBe(plain.out());
expect(h.out() + h.err()).not.toMatch(/smtpfa|SMTPFAST/i);
});

it("shows the subject, recipients and posts on a dry run, and sends nothing", async () => {
const h = harness();
expect(await h.exec([...emailArgs, "--dry-run"], sendEnv())).toBe(0);
Expand Down Expand Up @@ -466,7 +475,6 @@ describe("digest --email", () => {
["digest", "--email", Array.from({ length: 101 }, (_, i) => `u${i}@team.dev`).join(","), "--from", "[email protected]"],
["digest", "--email", "[email protected]", "--from", "[email protected]", "--format", "html"],
["digest", "--from", "[email protected]"],
["digest", "--dry-run"],
["digest", "--format", "pdf"],
["digest", "--format", "html", "--json"],
["digest", "nope"],
Expand Down
Loading