summaryrefslogtreecommitdiff
path: root/kenku
blob: 45b1f9c2f2a9c1eb3c36c630837ea193d627c6c3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/run/current-system/profile/bin/guile \
-L .
!#
;; kenku --- crawl and reproduce github actions
;; Copyright © 2026 bdunahu <bdunahu@operationnull.com>
;;
;; This program is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;;
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;; GNU General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with this program.  If not, see <https://www.gnu.org/licenses/>.

(use-modules (ice-9 match)
             ((src poll-repos) #:prefix poll:)
             ((src crawl-actions-wrapper) #:prefix get-act:)
             ((src crawl-newest-commits) #:prefix new-commit:)
             ((src crawl-type-wrapper) #:prefix get-type:)
             ((src crawl-lockfiles) #:prefix get-lock:)
             ((src build-actions) #:prefix build:))

(define (main . args)
  (match args
    (("poll" . args)
     (poll:poll-repos))
    (("crawl" . args)
     (get-act:crawl-actions))
    (("commits" . args)
     (new-commit:crawl-commits))
    (("types" . args)
     (get-type:crawl-types))
    (("lock" . args)
     (get-lock:crawl-lockfiles))
    (("build" . args)
     (build:build-actions))
    (anything
     (format (current-error-port)
             "Usage: kenku <command>

Commands:
  poll
      write a bunch of github repos to cache
  crawl
      write the referenced workflows from each polled repo
  commits
      get the newest commits of each referenced action
  types
      get the types of the newest referenced actions
  lock
      get the package manager used by each node action
  build
      build all npm actions in a container~%"))))

(apply main (cdr (command-line)))

;; Local Variables:
;; mode: scheme
;; End: