diff options
| author | ckonstanski <carlos.konstanski@olo.com> | 2021-05-30 21:49:24 -0600 |
|---|---|---|
| committer | ckonstanski <carlos.konstanski@olo.com> | 2021-05-30 21:49:24 -0600 |
| commit | 26523dcfd30586636a1f21a1b592b6be8c8099e2 (patch) | |
| tree | a49eb1af86ced84536bf5355bf784d275b41215d | |
| parent | 7f7f364f0a3cf3da7dd50c7f134169530752bf51 (diff) | |
dependency on org-ckons-condition
| -rw-r--r-- | org-ckons-file.asd | 8 | ||||
| -rw-r--r-- | src/file.lisp | 19 |
2 files changed, 6 insertions, 21 deletions
diff --git a/org-ckons-file.asd b/org-ckons-file.asd index 203cb6f..c5467f1 100644 --- a/org-ckons-file.asd +++ b/org-ckons-file.asd @@ -1,10 +1,10 @@ ;;; -*- Mode: Lisp; Syntax: ANSI-Common-Lisp; Base: 10 -*- (declaim (optimize (speed 0) (safety 3) (debug 3))) -(in-package #:cl) +(in-package :cl) -(defpackage #:org-ckons-file-system (:use #:cl #:asdf)) -(in-package #:org-ckons-file-system) +(defpackage :org-ckons-file-system (:use :cl :asdf)) +(in-package :org-ckons-file-system) (defmacro do-defsystem (&key name version maintainer author description long-description depends-on components) `(defsystem ,name @@ -18,7 +18,7 @@ :components ,components)) (defparameter *quicklisp-packages* '()) -(defparameter *asdf-packages* '(org-ckons-core)) +(defparameter *asdf-packages* '(org-ckons-core org-ckons-condition)) (defparameter *all-packages* (append *quicklisp-packages* *asdf-packages*)) (loop for pkg in *quicklisp-packages* do diff --git a/src/file.lisp b/src/file.lisp index ab8c76a..177d375 100644 --- a/src/file.lisp +++ b/src/file.lisp @@ -4,7 +4,7 @@ (defpackage :org-ckons-file (:use :cl)) -(in-package #:org-ckons-file) +(in-package :org-ckons-file) (defun compile-and-load (filename) "Compiles and then loads a file. `filename' should not have an @@ -57,21 +57,6 @@ line at a time." (defun mkdir (path) (org-ckons-core::shell-wrapper (format nil "mkdir -p ~a" path))) -(defun copy-file (source destination) - "Copies file from `source' to `destination'. If the destination -directory does not exist, it will be created." - (when (and (file-exists-p source) - (file-p source) - (not (org-ckons-core::null-or-empty-p destination))) - (let ((destination-parts (nreverse (remove-if #'org-ckons-core::null-or-empty-p (ppcre:split "/" destination)))) - (destination-file "") - (destination-directory "")) - (setf destination-file (pop destination-parts)) - (loop for part in (nreverse destination-parts) do - (setf destination-directory (format nil "~a/~a" destination-directory part))) - (mkdir destination-directory) - (org-ckons-core::shell-wrapper (format nil "cp '~a' '~a'" source destination))))) - (defun purge-old-files (directory-path) "Deletes everything out of a directory that is older than 8 hours old." @@ -88,7 +73,7 @@ old." (defun file-mtime (file-path) (let ((output (car (org-ckons-core::shell-wrapper (format nil "ls --full-time '~a' |awk '{ print $6,$7 }' |awk -F. '{ print $1; }'" file-path))))) (if (not (org-ckons-core::match-it "^\\d\\d\\d\\d-\\d\\d-\\d\\d \\d\\d:\\d\\d:\\d\\d$" output)) - (error 'handled-error :text (format nil "Error in `file-mtime': ~a" output)) + (error 'org-ckons-condition::handled-error :text (format nil "Error in `file-mtime': ~a" output)) output))) (defun directory-p (absolute-path) |
