File tree Expand file tree Collapse file tree
clj/src/vim_clojure_static Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22
33(ns vim-clojure-static.update
44 (:require [clojure.string :as string]
5- [clojure.java.shell :as shell]))
5+ [clojure.java.shell :refer [sh]])
6+ (:import (java.text SimpleDateFormat)
7+ (java.util Date)))
68
79(defn update-vim!
810 " Update Vim repository runtime files in dst/runtime"
1113 indent-file (join dst " runtime/doc/indent.txt" )
1214 indent-buf (slurp indent-file)
1315 indent-match (re-find #"(?ms)^CLOJURE.*?(?=^[ \p {Lu}]+\t *\* )" indent-buf)
14- indent-doc (re-find #"(?ms)^CLOJURE.*(?=^ABOUT)" (slurp (join src " doc/clojure.txt" )))]
16+ indent-doc (re-find #"(?ms)^CLOJURE.*(?=^ABOUT)" (slurp (join src " doc/clojure.txt" )))
17+ current-date (.format (SimpleDateFormat. " dd MMMM YYYY" ) (Date. ))
18+ current-tag (string/trim-newline (:out (sh " git" " tag" " --points-at" " HEAD" )))]
19+ (assert (seq current-tag) " Git HEAD is not tagged!" )
1520 ; ; Insert indentation documentation
1621 (spit indent-file (string/replace-first indent-buf
1722 indent-match
2025 (doseq [file [" autoload/clojurecomplete.vim"
2126 " ftplugin/clojure.vim"
2227 " indent/clojure.vim"
23- " syntax/clojure.vim" ]]
24- (shell/sh " cp" (join src file) (join dst " runtime" file)))))
28+ " syntax/clojure.vim" ]
29+ :let [buf (-> (join src file)
30+ slurp
31+ (string/replace " %%RELEASE_DATE%%" current-date)
32+ (string/replace " %%RELEASE_TAG%%" current-tag))]]
33+ (spit (join dst " runtime" file) buf))))
2534
2635(comment
2736 (update-vim! " /home/guns/src/vim-clojure-static" " /home/guns/src/vim" ))
You can’t perform that action at this time.
0 commit comments