Skip to content

Commit

Permalink
WIP initial concept
Browse files Browse the repository at this point in the history
  • Loading branch information
eigenhombre committed Nov 20, 2022
0 parents commit cfc32d2
Show file tree
Hide file tree
Showing 9 changed files with 91 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
**/*.asd
**/*.fasl
steelcut
14 changes: 14 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
.PHONY: clean install test

steelcut: src/*.lisp
./build.sh

test:
./test.sh

clean:
rm -rf steelcut

install: steelcut
test -n "$(BINDIR)" # $$BINDIR
cp steelcut ${BINDIR}
13 changes: 13 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/sh

# Adapted from
# https://github.com/cicakhq/potato/blob/master/tools/build_binary.sh;
# Quicklisp path hack from
# https://www.darkchestnut.com/2016/quicklisp-load-personal-projects-from-arbitrary-locations/

sbcl --non-interactive \
--disable-debugger \
--eval '(pushnew (truename ".") ql:*local-project-directories*)' \
--eval '(ql:register-local-projects)' \
--eval '(ql:quickload :steelcut)' \
--eval '(progn (sb-ext:disable-debugger) (sb-ext:save-lisp-and-die "steelcut" :toplevel #'"'"'steelcut:main :executable t))'
34 changes: 34 additions & 0 deletions src/main.lisp
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
(in-package #:steelcut)

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

(defun str (&rest args)
(format nil "~{~a~}" args))

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

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

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

(project-path "steelcut")

(defun make-project (projname)
(ensure-directories-exist (str (project-path projname) "/")))

(make-project "foo")
(project-path "foo")
(find-project "foo")
(find-project "food")

(defun destroy-project!!! (projname)
(fad:delete-directory-and-files (project-path projname)))

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

(defun main ()
(format t "Thanks for using steelcut!~%"))
3 changes: 3 additions & 0 deletions src/package.lisp
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
(defpackage steelcut
(:use :cl :arrows :cl-fad)
(:export :main))
1 change: 1 addition & 0 deletions system-index.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
steelcut.asd
14 changes: 14 additions & 0 deletions test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/sh

# Adapted from
# https://github.com/cicakhq/potato/blob/master/tools/build_binary.sh;
# Quicklisp path hack from
# https://www.darkchestnut.com/2016/quicklisp-load-personal-projects-from-arbitrary-locations/

sbcl --non-interactive \
--disable-debugger \
--eval '(pushnew (truename ".") ql:*local-project-directories*)' \
--eval '(ql:register-local-projects)' \
--eval '(ql:quickload :1AM)' \
--eval '(ql:quickload :steelcut)' \
--eval '(asdf:test-system :steelcut/test)'
3 changes: 3 additions & 0 deletions test/package.lisp
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
(defpackage :steelcut.test
(:use :cl :1am)
(:export :run-tests))
6 changes: 6 additions & 0 deletions test/test.lisp
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
(in-package #:steelcut.test)

(defun run-tests () (1am:run))

(test example
(is (equal 2 (+ 1 1))))

0 comments on commit cfc32d2

Please sign in to comment.