Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

cli config check

Suraj93f16b3da088
diff --git a/packages/cli/src/commands/link.ts b/packages/cli/src/commands/link.ts
index 63d50b3db1..7ab3bc53a7 100644
--- a/packages/cli/src/commands/link.ts
+++ b/packages/cli/src/commands/link.ts
@@ -1,3 +1,4 @@
+import { getConfig } from "@/utils/get-config";
import { createLink, getLinks } from "@/utils/get-links";
import { getNanoid } from "@/utils/get-nanoid";
import { handleError } from "@/utils/handle-error";
@@ -20,6 +21,8 @@ export const link = new Command()
.argument("[key]", "Short key", getNanoid())
.action(async (url, key) => {
try {
+ await getConfig();
+
let linkData = { url, key };
if (!url) {
@@ -87,6 +90,8 @@ link
.description("View the list of the last 100 links")
.action(async () => {
try {
+ await getConfig();
+
const spinner = ora("Fetching links").start();
const links = await getLinks();
spinner.stop();