template writing done

This commit is contained in:
lxsameer 2010-12-28 18:49:24 +03:30
parent a9dc6dddf2
commit adecde4890
2 changed files with 5 additions and 9 deletions

View File

@ -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."
)

View File

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