Skip to content

Commit a7ed476

Browse files
committed
Add util to post to gist
1 parent bfa87fe commit a7ed476

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

utils.lisp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,3 +294,17 @@ the subdirectory is absent or inconsistent."
294294
(#\Nul
295295
(write-string "[nul]" s))
296296
(t (write-char char s))))))
297+
298+
(defun gist-file (&key (description "No description") pathname (public t))
299+
(unless pathname
300+
(error "Pathname required"))
301+
(flet ((js (&rest args)
302+
(apply #'githappy:js args))
303+
(table (&rest args)
304+
(apply #'githappy:table args)))
305+
(let ((value (alexandria:read-file-into-string pathname))
306+
(key (file-namestring pathname)))
307+
(githappy:create-gist :body
308+
(githappy:js "description" description
309+
"public" public
310+
"files" (table key (table "content" value)))))))

0 commit comments

Comments
 (0)