From 921c5a127c76c30c63451e55cbd5b0c59476a5ed Mon Sep 17 00:00:00 2001 From: Boutade Date: Mon, 15 Apr 2019 13:31:21 -0500 Subject: Added CLI --- imbricate.ros | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) (limited to 'imbricate.ros') diff --git a/imbricate.ros b/imbricate.ros index 5828da1..fbdf700 100755 --- a/imbricate.ros +++ b/imbricate.ros @@ -1,12 +1,12 @@ -;; #!/bin/sh -;; #|-*- mode:lisp -*-|# -;; #| -;; exec ros -Q -- $0 "$@" -;; |# -;; (progn ;;init forms -;; (ros:ensure-asdf) -;; #+quicklisp(ql:quickload '(imago cl-fad) :silent t) -;; ) +#!/bin/sh +#|-*- mode:lisp -*-|# +#| +exec ros -Q -- $0 "$@" +|# +(progn ;;init forms + (ros:ensure-asdf) + #+quicklisp(ql:quickload '(imago cl-fad) :silent t) + ) (defpackage :ros.script.imbricate.3764151058 (:use :cl)) @@ -136,5 +136,13 @@ (defun main (&rest argv) - (declare (ignorable argv))) + (declare (ignorable argv)) + (destructuring-bind (path target) argv + (let* ((tile-stats (images-under-dir path)) + (packlist (build-packlist tile-stats)) + (tilesheet (pack-images packlist)) + (tile-index (packlist->tile-index packlist))) + (imago:write-png tilesheet (format nil "~a.png" target)) + (write-tile-index tile-index (format nil "~a-index.lisp" target)))) + (format t "ALL DONE~%")) ;;; vim: set ft=lisp lisp: -- cgit v1.2.3