Commits

Peter Bex committed 42a7c9a

Fix moving files for real

Comments (0)

Files changed (1)

-(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
        (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)))