Coverage report: /home/ellis/comp/core/app/packy/client.lisp

KindCoveredAll%
expression048 0.0
branch06 0.0
Key
Not instrumented
Conditionalized out
Executed
Not executed
 
Both branches taken
One branch taken
Neither branch taken
1
 ;;; packy/client.lisp --- Packy Client
2
 
3
 ;; Client-side API for Packy.
4
 
5
 ;;; Commentary:
6
 
7
 ;; The client is responsible for fetching packages from a registry,
8
 ;; organizing packages, and making them available to the user.
9
 
10
 ;;; Code:
11
 (in-package :packy)
12
 
13
 (defstruct packy-client)
14
 
15
 (defun pk-index (&optional (name "packs"))
16
   (let ((url (obj/uri:merge-uris (concatenate 'string name ".json") *packy-url*)))
17
     (with-input-from-string (s (req:get url))
18
       (dat/json::json-read s nil))))
19
 
20
 (defun init-packy (&key reset columns (tree-sitter t))
21
   (ensure-directories-exist *packy-home*)
22
   (when (and reset *packy-db*) (db:shutdown-db *packy-db* :wait t))
23
   (unless *packy-db* (init-packy-db))
24
   (unless (db:db-open-p *packy-db*)
25
     (when (probe-file (name *packy-db*))
26
       (rdb:load-opts *packy-db* :backfill :full))
27
     (progn
28
       (db:open-db *packy-db*)
29
       (when columns
30
         (apply 'db:open-columns *packy-db* columns))))
31
   (when tree-sitter
32
     (tree-sitter:load-tree-sitter)
33
     (tree-sitter:load-tree-sitter-alien)
34
     (tree-sitter:load-tree-sitter-bash)))