Changed Makefile.md -> Makefile.mk and used find-system-path for Home directory.

This commit is contained in:
2026-08-31 14:46:21 +02:00
parent 3f7b613273
commit fd1cac18aa
3 changed files with 21 additions and 10 deletions
+39
View File
@@ -0,0 +1,39 @@
#lang racket/base
(require racket-makefile)
(define test-install #f)
(makefile 'skill
(target 'all
(displayln "Use (make 'install)"))
(target 'install
(let ((home (find-system-path 'home-dir)))
(when (eq? home #f)
(error "No home directory?, cannot find place of .codex"))
(let* ((pwd (current-directory))
(skilld (build-path home ".codex" "skills"))
(racket-skilld (build-path skilld "racket-skill"))
(js-skilld (build-path skilld "javascript-skill"))
(cp (lambda (to-dir file)
(let ((from (build-path pwd file))
(to (build-path to-dir "SKILL.md")))
(unless (directory-exists? to-dir)
(make-directory to-dir))
(displayln (format "cp ~a -> ~a" from to))
(unless test-install
(copy-file from to #:exists-ok? #t)))))
)
(cp racket-skilld "racket-skill.md")
(cp js-skilld "javascript-skill.md")
)))
(target 'test-install
(set! test-install #t)
(make 'install)
(set! test-install #f))
)