diff options
author | Peter Bex <peter@more-magic.net> | 2011-09-14 21:58:02 +0200 |
---|---|---|
committer | Peter Bex <peter@more-magic.net> | 2011-09-14 21:58:02 +0200 |
commit | 53c4c002dd0126830ec75bbf8bdf37fc6a99d0a2 (patch) | |
tree | f605334ab9ab3c8a0c2fefd5167d3c677b6957c7 /henrietta-cache.scm | |
parent | bf46c1aa37418069eb457f0d16b85ffcebc9dbba (diff) | |
download | henrietta-cache-53c4c002dd0126830ec75bbf8bdf37fc6a99d0a2.tar.gz |
Fix moving files for real
Diffstat (limited to 'henrietta-cache.scm')
-rw-r--r-- | henrietta-cache.scm | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/henrietta-cache.scm b/henrietta-cache.scm index 924b65a..1dc264c 100644 --- a/henrietta-cache.scm +++ b/henrietta-cache.scm @@ -1,4 +1,4 @@ -(use utils posix setup-api http-client matchable uri-common srfi-1) +(use utils posix http-client matchable uri-common srfi-1) (define (usage code) (print #<#EOF @@ -110,9 +110,12 @@ EOF (let* ((contents (directory tmpdir)) (contents-dir (if (= 1 (length contents)) (make-pathname tmpdir (car contents)) - tmpdir))) - (move-file contents-dir cache-dir) - (system (sprintf "rm -rf ~A" (qs tmpdir)))))) + tmpdir)) + (cmd (sprintf "mv ~A/* ~A" (qs contents-dir) (qs cache-dir))) + (status (system cmd))) + (system (sprintf "rm -rf ~A" (qs tmpdir))) + (unless (zero? status) + (error "Got an error executing command" cmd))))) ((meta-file) (condition-case (let* ((meta (car (call-with-input-request uri #f read-file))) |