Skip to content

Commit

Permalink
Functionality for .gitignore.
Browse files Browse the repository at this point in the history
  • Loading branch information
eigenhombre committed Nov 20, 2022
1 parent cfc32d2 commit e89c3b0
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 7 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
**/*.asd
**/*.fasl
steelcut
30 changes: 25 additions & 5 deletions src/main.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,20 @@

(defun lisp-home () (uiop:getenv "LISP_HOME"))

(defun str (&rest args)
(format nil "~{~a~}" args))
(defun join-w-sep (sep args)
(let ((sep-fmt (format nil "~~{~~a~~^~a~~}" sep)))
(format nil sep-fmt args)))

(defun join (&rest args)
(join-w-sep "/" args))

(defun project-path (projname)
(str (lisp-home) "/" projname))
(join (lisp-home) projname))

(defun find-project (projname)
(uiop:probe-file* (project-path projname)))

(project-path "steelcut")
(find-project "steelcut")
(find-project "steelcutter")

Expand All @@ -27,8 +32,23 @@
(defun destroy-project!!! (projname)
(fad:delete-directory-and-files (project-path projname)))

(destroy-project!!! "foo")
(find-project "foo")
(comment
(destroy-project!!! "foo")
(find-project "foo"))

(defun add-project-file (projname filename contents)
(spit (join (project-path projname) filename) contents))

(defun add-gitignore (projname)
(add-project-file projname ".gitignore"
(format nil "**/*.fasl
~a
"
projname)))

(add-gitignore "foo")

(slurp (join (project-path "foo") ".gitignore"))

(defun main ()
(format t "Thanks for using steelcut!~%"))
2 changes: 1 addition & 1 deletion src/package.lisp
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
(defpackage steelcut
(:use :cl :arrows :cl-fad)
(:use :cl :arrows :cl-fad :cl-oju)
(:export :main))
26 changes: 26 additions & 0 deletions steelcut.asd
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
(defsystem :steelcut
:description "Common Lisp Project Generator"
:author "John Jacobsen"
:license "MIT"
:build-operation "program-op"
:build-pathname "steelcut"
:entry-point "steelcut:main"
:depends-on (:arrows
:cl-fad
:cl-oju)
:components ((:module "src"
:components ((:file "package")
(:file "main" :depends-on ("package"))))))

(defsystem :steelcut/test
:description "FIXME"
:author "FIXME"
:license "FIXME"
:depends-on (:steelcut :1am)
:serial t
:components ((:module "test"
:serial t
:components ((:file "package")
(:file "test"))))
:perform (asdf:test-op (op system)
(funcall (read-from-string "steelcut.test:run-tests"))))

0 comments on commit e89c3b0

Please sign in to comment.