From 9df3b848e01661db574137348eb86e867eeaede5 Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Sat, 1 Mar 2014 20:40:06 +0100 Subject: Simplify save-repositories-list Simplify `save-repositories-list' by extracting some of the functionality into its own procedures. Since there is now a `repository-name)) -(define (repository)) (force (slot-ref branch 'pullable))) diff --git a/gitto/main.scm b/gitto/main.scm index f8eeb18..f4efeae 100644 --- a/gitto/main.scm +++ b/gitto/main.scm @@ -43,7 +43,8 @@ (define (list-repository-locations) "List the registered locations of repositories." - (for-each print-repository-location (sort repositories repository. (define-module (gitto path) - #:export (realpath)) + #:export (realpath + ensure-directory-exists.)) (load-extension "libguile-gitto-path" "init_gitto") + +(define (ensure-directory-exists. path) + "Make sure PATH exists. + +Check if PATH exists, and if so do nothing. If PATH doesn't exist, +create it." + (unless (file-exists? path) + (mkdir path))) -- cgit v1.2.3-54-g00ecf