From fd1cac18aa62acfe58fa7cd9e75bd7c9245f6d34 Mon Sep 17 00:00:00 2001 From: Hans Dijkema Date: Mon, 31 Aug 2026 14:46:21 +0200 Subject: [PATCH] Changed Makefile.md -> Makefile.mk and used find-system-path for Home directory. --- .gitignore | 1 + Makefile.md => Makefile.mk | 28 +++++++++++++++++++--------- make.sh | 2 +- 3 files changed, 21 insertions(+), 10 deletions(-) rename Makefile.md => Makefile.mk (54%) diff --git a/.gitignore b/.gitignore index 39a4f9c..9ed0458 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,7 @@ *.rkt.bak \#*.rkt# \#*.rkt#*# +*.bak # Compiled racket bytecode compiled/ diff --git a/Makefile.md b/Makefile.mk similarity index 54% rename from Makefile.md rename to Makefile.mk index e3172b4..3ba7c44 100644 --- a/Makefile.md +++ b/Makefile.mk @@ -2,28 +2,38 @@ (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")) (js-skilld (build-path skilld "javascript-skill")) (cp (lambda (to-dir file) - (let ((from (build-path pwd 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)) - (copy-file from to #:exists-ok? #t)))) - ) + (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)) + + ) diff --git a/make.sh b/make.sh index f9091b3..139d37e 100755 --- a/make.sh +++ b/make.sh @@ -1,2 +1,2 @@ #!/bin/bash -racket -e "(enter! \"Makefile.md\") (make 'install)" +racket -e "(enter! \"Makefile.mk\") (make 'install)"