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.bak
|
||||||
\#*.rkt#
|
\#*.rkt#
|
||||||
\#*.rkt#*#
|
\#*.rkt#*#
|
||||||
|
*.bak
|
||||||
|
|
||||||
# Compiled racket bytecode
|
# Compiled racket bytecode
|
||||||
compiled/
|
compiled/
|
||||||
|
|||||||
@@ -2,14 +2,16 @@
|
|||||||
|
|
||||||
(require racket-makefile)
|
(require racket-makefile)
|
||||||
|
|
||||||
|
(define test-install #f)
|
||||||
|
|
||||||
(makefile 'skill
|
(makefile 'skill
|
||||||
(target 'all
|
(target 'all
|
||||||
(displayln "Use (make 'install)"))
|
(displayln "Use (make 'install)"))
|
||||||
|
|
||||||
(target 'install
|
(target 'install
|
||||||
(let ((home (getenv "HOME")))
|
(let ((home (find-system-path 'home-dir)))
|
||||||
(when (eq? home #f)
|
(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))
|
(let* ((pwd (current-directory))
|
||||||
(skilld (build-path home ".codex" "skills"))
|
(skilld (build-path home ".codex" "skills"))
|
||||||
(racket-skilld (build-path skilld "racket-skill"))
|
(racket-skilld (build-path skilld "racket-skill"))
|
||||||
@@ -20,10 +22,18 @@
|
|||||||
(unless (directory-exists? to-dir)
|
(unless (directory-exists? to-dir)
|
||||||
(make-directory to-dir))
|
(make-directory to-dir))
|
||||||
(displayln (format "cp ~a -> ~a" from to))
|
(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 racket-skilld "racket-skill.md")
|
||||||
(cp js-skilld "javascript-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