lfe-deprecated / lfetool

DEPRECATED - See:
https://github.com/lfe-rebar3/
Other
61 stars 19 forks source link

Replace manual path construct by filename:join #74

Closed unbalancedparentheses closed 10 years ago

unbalancedparentheses commented 10 years ago
(defun get-template-file (plugin-name file-name)
  "Given a plugin name and a template file name, deduce and return the path
  to the file."
  (++ (lfetool-util:get-cwd)
      "/plugins/" (atom_to_list plugin-name)
      "/templates/" file-name))```

You can simplify this using filename:join. You won't need to cast values or write / before and after plugins and templates.
oubiwann commented 10 years ago

On Sun, Jun 29, 2014 at 7:30 PM, Federico Carrone notifications@github.com wrote:

(defun get-template-file (plugin-name file-name) "Given a plugin name and a template file name, deduce and return the path to the file." (++ (lfetool-util:get-cwd) "/plugins/" (atom_to_list plugin-name) "/templates/" file-name))``` You can simplify this using filename:join. You won't need to cast values or write / before and after plugins and templates.

Thanks for the tip! I've already used this in a different part of the code (which hasn't been pushed yet). Tonight, I hope to update the part of the code you are referring to above ...

oubiwann commented 10 years ago

Done in d591785.

Thanks again!