Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (defun full-archive (git-path target-ref output-file)
- (run "git" "-C" (truename git-path)
- "submodule" "update" "--init" "--recursive")
- (let ((submodules (submodules git-path))
- (prefix (pathname-name output-file)))
- (in-temporary-directory
- (let* ((temp-base *default-pathname-defaults*))
- (with-posix-cwd git-path
- (run "git" "archive"
- :format "tar"
- :prefix (format nil "~A/" prefix)
- "-o" (make-pathname :name prefix
- :type "tar"
- :defaults temp-base)
- target-ref)
- (dolist (submodule submodules)
- (with-posix-cwd (submodule-path submodule)
- (let ((output (make-pathname :name (submodule-name submodule)
- :type "tar"
- :defaults temp-base)))
- (run "git" "archive"
- :format "tar"
- "-o" output
- :prefix (format nil "~A/~A/"
- prefix (submodule-path submodule))
- (submodule-sha1 submodule))))))
- ;; Back in the temp directory
- (dolist (tarball (directory "*.tar"))
- (run "tar" "xf" tarball))
- (run "tar" "cf" output-file prefix)))))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement