template writing done
This commit is contained in:
parent
a9dc6dddf2
commit
adecde4890
|
@ -44,15 +44,10 @@ already opend buffer died after reading content."
|
|||
"Write the STRING into FILE if file was writable."
|
||||
(if (file-writable-p FILE)
|
||||
(with-temp-buffer
|
||||
(insert STR)
|
||||
(insert STRING)
|
||||
(write-region (point-min)
|
||||
(point-max)
|
||||
FILE)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
(defun io/join-path (a b)
|
||||
"safe join a and b addresses."
|
||||
|
||||
)
|
||||
|
|
|
@ -109,11 +109,12 @@ destenation file address created from template FILE name.
|
|||
|
||||
(let (curfile destfile)
|
||||
(setq curfile (split-string FILE "/"))
|
||||
|
||||
(setq curfile (car (last curfile)))
|
||||
(setq curfile (replace-regexp-in-string "__project__" unix-project-name curfile))
|
||||
(setq curfile (replace-regexp-in-string "\.tmpl" "" curfile))
|
||||
(setq destfile (concat project-path curfile))
|
||||
(log destfile)
|
||||
;; safe path join (path generated here)
|
||||
(setq destfile (expand-file-name curfile project-path))
|
||||
(io/write destfile DATA)
|
||||
)
|
||||
)
|
||||
|
Loading…
Reference in New Issue