-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrepositories.clj
executable file
·40 lines (28 loc) · 1.47 KB
/
repositories.clj
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/usr/bin/env bb
(defn git-clone [{:keys [url path dirname]}]
(let [abs-path (str path "/" dirname)
dir-not-exist? (not (.isDirectory (io/file abs-path)))]
(if dir-not-exist?
(do (println "cloning " url)
(shell/sh "git" "clone" url abs-path))
(println "skipping git clone: directory" abs-path "already exists"))))
;; Configurations
(def home (System/getenv "HOME"))
(def repositories {:emacs-configuration {:url "[email protected]:hlissner/doom-emacs.git"
:dirname ".emacs.d"
:path home}
:dotfiles {:url "[email protected]:karthikmuralidharan/dotfiles.git"
:dirname ".dotfiles"
:path home}
:notes {:url "[email protected]:karthikmuralidharan/notes.git"
:dirname "notes"
:path home}
:dotfiles-private {:url "[email protected]:karthikmuralidharan/dotfiles-private.git"
:dirname ".dotfiles-private"
:path home}
:emacs-personal-configuration {:url "[email protected]:karthikmuralidharan/doom-emacs-private.git"
:dirname ".doom.d"
:path home}})
(let [repo-items (vals repositories)]
(doseq [item repo-items]
(git-clone item)))