diff --git a/src/lib/io.el b/src/lib/io.el index 863988f..cd5ff3e 100644 --- a/src/lib/io.el +++ b/src/lib/io.el @@ -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." - -) diff --git a/src/lib/project.el b/src/lib/project.el index d67b65b..6f44186 100644 --- a/src/lib/project.el +++ b/src/lib/project.el @@ -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) ) ) - \ No newline at end of file