-
Notifications
You must be signed in to change notification settings - Fork 1
/
github.lisp
24 lines (22 loc) · 1.12 KB
/
github.lisp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
(uiop/package:define-package :ql-checkout/github (:use :cl :ql-checkout/config) (:export :clone-github :pull-github))
(in-package :ql-checkout/github)
;;;don't edit above
(defun clone-github (owner/name &key
branch
(checkoutdir *checkoutdir*))
(let ((dir (merge-pathnames (format nil "~A/" owner/name) checkoutdir)))
(setq branch (if branch (format nil "-b ~A" branch) ""))
(if (uiop:probe-file* dir)
()
(uiop:run-program (format nil "git clone ~A https://github.com/~A.git ~A"
branch
owner/name
(namestring (ensure-directories-exist dir)))))
dir))
(defun pull-github (owner/name &key (checkoutdir *checkoutdir*))
(let ((dir (merge-pathnames (format nil "~A/" owner/name) checkoutdir)))
(if (uiop:probe-file* dir)
(uiop:run-program (format nil "cd ~A;git pull"
(namestring dir))
:output :interactive)
(format t "pull ~A.directory not exist.Not cloned? ~%" owner/name))))