Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default template not considered #1

Open
stefanwalther opened this issue Jul 19, 2016 · 7 comments
Open

Default template not considered #1

stefanwalther opened this issue Jul 19, 2016 · 7 comments

Comments

@stefanwalther
Copy link

The default template ~/templates/_editorconfig is not being considered.

I use:

  • Node: 5.0.0
  • Update: v0.6.2
  • updater-config: v0.1.0
@jonschlinkert
Copy link
Member

Can you try adding the template to ~/generate/templates? Looks like the docs are wrong in a few places. sorry about that

@stefanwalther
Copy link
Author

stefanwalther commented Jul 19, 2016

So you mean that also update is looking for templates in the ~/generate/templates folder?

To be honest, I really don't want to create one root folder for generate, another for generate, etc.?
Is this the plan?
I guess this is because in some updaters you are using a generator, but this is not the case for updater-editorconfig

@stefanwalther
Copy link
Author

Doesn't matter which documentation I have a look into (generators or updaters), you always mention ~/templates/foo

@jonschlinkert
Copy link
Member

So you mean that also update is looking for templates in the ~/generate/templates folder?

no, sorry typo, update will look in ~/update/templates. But I just realized I haven't pushed up the code for update to use the custom directory yet anyway.

To be honest, I really don't want to create one root folder for generate, another for generate, etc.? Is this the plan?

Per my previous comments, I don't know lol. This is why I asked for your feedback. I personally don't want to create folders for each app either. I'd rather have one ~/templates directory. But templates aren't the only thing you can customize with these apps, so I was leaning towards using ~/%appname% as the root for user-defined config, templates etc. But I honestly don't care where stuff goes.

Also, I mentioned this already but maybe you didn't see it. No matter what the defaults are, you will be able to customize the paths to be whatever you want once I get a chance to implement the code.

@stefanwalther
Copy link
Author

I double-checked it with ~/update/templates and it doesn't work.

Another observation (will file that also to update since I believe it's a global issue):

  • If I cd to a sub-directory, still the root directory of a project (actually where the package.json) will be considered, so in this case the editorconfig will be placed into the wrong directory.

Does this make sense?

@jonschlinkert
Copy link
Member

I haven't pushed up the code for update to use the custom directory yet

That's to be expected until I implement the feature.

If I cd to a sub-directory, still the root directory of a project (actually where the package.json) will be considered, so in this case the editorconfig will be placed into the wrong directory.

with generate or update? It only cd's to the root of a project when:

  • the directory is not empty, and
  • the directory does not have a package.json

IMO this makes sense. Otherwise it would make it harder to do scaffolding in an existing project

@stefanwalther
Copy link
Author

If I cd to a sub-directory, still the root directory of a project (actually where the package.json) will be considered, so in this case the editorconfig will be placed into the wrong directory.

OK, I get it. In case of .editorconfig, .gitattributes, etc. this makes sense. But I think that's a limitation of the use-cases of update.

Just to give you an example:

  • I am writing a lot of code-examples
  • All these examples should be self-containing, so without any dependencies
  • Therefore I'd like to go to directory XYZ and just do an update add-my-magic-script here
  • I use this script in many examples, so ´update` is of big value for me
  • But the cd-up-to-package-json is actually very limiting in my use-cases

Makes sense?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants