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
+1
View File
@@ -7,6 +7,7 @@
*.rkt.bak
\#*.rkt#
\#*.rkt#*#
*.bak
# Compiled racket bytecode
compiled/
+13 -3
View File
@@ -2,14 +2,16 @@
(require racket-makefile)
(define test-install #f)
(makefile 'skill
(target 'all
(displayln "Use (make 'install)"))
(target 'install
(let ((home (getenv "HOME")))
(let ((home (find-system-path 'home-dir)))
(when (eq? home #f)
(error "No $HOME environment variable, cannot find place of .codex"))
(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"))
@@ -20,10 +22,18 @@
(unless (directory-exists? to-dir)
(make-directory to-dir))
(displayln (format "cp ~a -> ~a" from to))
(copy-file from to #:exists-ok? #t))))
(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))
)
+1 -1
View File
@@ -1,2 +1,2 @@
#!/bin/bash
racket -e "(enter! \"Makefile.md\") (make 'install)"
racket -e "(enter! \"Makefile.mk\") (make 'install)"