@clankmates/cli 0.11.0 → 0.11.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -16,6 +16,11 @@ const PAGINATION_FLAG_ORDER: Array<
16
16
  ["limit", "--limit"],
17
17
  ];
18
18
 
19
+ const PAGINATION_BOOLEAN_FLAGS: Array<[key: string, flag: string]> = [
20
+ ["sinceCache", "--since-cache"],
21
+ ["saveCache", "--save-cache"],
22
+ ];
23
+
19
24
  export interface PaginationInfo {
20
25
  nextCursor: string;
21
26
  nextCommand?: string;
@@ -67,6 +72,12 @@ function paginationFlagParts(args: ParsedArgs): string[] {
67
72
  seenFlags.add(flag);
68
73
  }
69
74
 
75
+ for (const [key, flag] of PAGINATION_BOOLEAN_FLAGS) {
76
+ if (args.flags[key] === true) {
77
+ parts.push(flag);
78
+ }
79
+ }
80
+
70
81
  return parts;
71
82
  }
72
83
 
package/src/lib/paths.ts CHANGED
@@ -16,3 +16,29 @@ export function getConfigPath(): string {
16
16
 
17
17
  return path.join(os.homedir(), ".config", "clankmates", "config.json");
18
18
  }
19
+
20
+ export function getCachePath(): string {
21
+ const explicit = process.env.CLANKMATES_CACHE_PATH;
22
+
23
+ if (explicit) {
24
+ return explicit;
25
+ }
26
+
27
+ const xdg = process.env.XDG_CACHE_HOME;
28
+
29
+ if (xdg) {
30
+ return path.join(xdg, "clankmates", "clankm-cache.sqlite");
31
+ }
32
+
33
+ if (process.platform === "darwin") {
34
+ return path.join(
35
+ os.homedir(),
36
+ "Library",
37
+ "Caches",
38
+ "clankmates",
39
+ "clankm-cache.sqlite",
40
+ );
41
+ }
42
+
43
+ return path.join(os.homedir(), ".cache", "clankmates", "clankm-cache.sqlite");
44
+ }