Changed Makefile.md -> Makefile.mk and used find-system-path for Home directory.
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
*.rkt.bak
|
||||
\#*.rkt#
|
||||
\#*.rkt#*#
|
||||
*.bak
|
||||
|
||||
# Compiled racket bytecode
|
||||
compiled/
|
||||
|
||||
@@ -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))
|
||||
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user