From 5ff106ac14a0d363a6f982394117d9705d694994 Mon Sep 17 00:00:00 2001 From: Hans Dijkema Date: Wed, 2 Sep 2026 23:18:57 +0200 Subject: [PATCH] .scm for scheme syntax --- Makefile.mk | 39 --------------------------------------- Makefile.scm | 44 ++++++++++++++++++++++++++++++++++++++++++++ make.sh | 2 +- 3 files changed, 45 insertions(+), 40 deletions(-) delete mode 100644 Makefile.mk create mode 100644 Makefile.scm diff --git a/Makefile.mk b/Makefile.mk deleted file mode 100644 index 3ba7c44..0000000 --- a/Makefile.mk +++ /dev/null @@ -1,39 +0,0 @@ -#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)) - - ) - diff --git a/Makefile.scm b/Makefile.scm new file mode 100644 index 0000000..7a83a5e --- /dev/null +++ b/Makefile.scm @@ -0,0 +1,44 @@ +#lang racket/base + +(require racket-makefile + racket/file) + +(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")) + (for-each (lambda (subdir) + (let* ((pwd (current-directory)) + (skilld (build-path home subdir)) ;".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") + )) + (list (build-path ".codex" "skills") + (build-path ".copilot" "skills"))) + )) + + + (target 'test-install + (set! test-install #t) + (make 'install) + (set! test-install #f)) + + ) + diff --git a/make.sh b/make.sh index 139d37e..77c47df 100755 --- a/make.sh +++ b/make.sh @@ -1,2 +1,2 @@ #!/bin/bash -racket -e "(enter! \"Makefile.mk\") (make 'install)" +racket -e "(enter! \"Makefile.scm\") (make 'install)"