@fabrao has joined the channel
hello all, how does it work? I want to create a custom template to my projects base, how do I do?
clj -A:new -M:new template myname/myapp
?@fabrao I'm not sure what you are asking...?
Did you read this section https://github.com/seancorfield/clj-new#clj-templates ?
yes, but I didn´t understand how the flow to create my own template
clj -m clj-new.create mytemplate myname/mynewapp first?
That creates you a new project that is setup like a template, yes.
If you plan to publish a template to Clojars, it must have a specific structure to its name (as explained in that link I posted above).
I want to use it locally
Or you can publish it to GitHub or you can use it locally (as a :local/root dependency).
Internally, templates have to have a very specific structure (again, explained above).
Then you can create new projects based on your template.
Think of a template as a library that generates projects.
`Execution error (FileNotFoundException) at clojure.main/main (main.java:40). Could not locate clj_new/create__init.class, clj_new/create.clj or clj_new/create.cljc on classpath. Please check that namespaces with dashes use underscores in the Clojure file name.` what is this for this error?
What command did you run to produce that error?
clj -m clj-new.create mytemplate myname/mynewapp
and beside, I´m running it on Windows
is that a problem?
That says you don't have clj-new on your class path.
That's not the same command you posted above (nor does it match the readme).
• template -- A minimal `clj-new` template. Can produce a new template with `clj -m clj-new.create mytemplate myname/mynewapp` (where `mytemplate` is the appropriate part of whatever project name you used when you asked `clj-new` to create the template project).
(! 636)-> clj -A:new -M:new template myname/myapp
Generating a project called myapp that is a 'clj-new' template
(! 637)-> clj -Sdeps '{:deps {myname/myapp {:local/root "myapp"}}}' -A:new -M:new myapp myname/myproject
Generating fresh 'clj new' myapp project.
(! 638)-> tree myproject
|____
| |____deps.edn
| |____src
| | |____myname
| | | |____myproject
| | | | |____foo.cljThe second command uses the myname/myapp project as the template for creating myname/myproject
ow, now I understand
I am removing "Can produce a new template with clj -m clj-new.create mytemplate myname/mynewapp (where mytemplate is the appropriate part of whatever project name you used when you asked clj-new to create the template project)." -- it assumes you understand that you need both clj-new and your new template on your classpath before you can use that.
yes, thats I thougth
I've added the above to the readme (using myname/mytemplate for the template and myname/myproject for the generated project).
thank you