Skip to content

add custom type for dub init #600

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

Closed
wants to merge 4 commits into from
Closed

add custom type for dub init #600

wants to merge 4 commits into from

Conversation

deviator
Copy link
Contributor

Example usage:
dub init MyApp gtk-d deslog -tcustom copies files from .dub/custom_init_package/ and replace in them some vars:

  • $name -> myapp
  • $Name -> MyApp
  • $deps_json -> "gtk-d": "3.1.3", "deslog": "0.2.0"

deviator added 4 commits June 22, 2015 12:10
use $Name to place package_name
use $name to place package_name.toLower()
use $deps_json to place dependecies, formated as json AA
@deviator deviator changed the title add custom type for dub init, fix #557 add custom type for dub init Jun 22, 2015
@MartinNowak
Copy link
Member

I guess your use-case is similar to git's template directory, right? What exactly are you using this for?

It seems that copying default files in a dub directory is orthogonal to initializing a particular kind of dub folder. It's also fairly easy to write your own dub_init wrapper script.

For the purpose of having special init types for other libraries, I think it'd be best to do this as executable targets in the libraries, e.g. dub init -t mylib args would fetch mylib and run dub run -c init mylib -- args.

@s-ludwig
Copy link
Member

This looks like (form a really quick glance) it's simply the generalization of the -t switch that we've discussed in similar form some time ago. Unfortunately I can't find the discussion now, but the idea was different in that dub init somelib would automatically look for a sub package somelib:init and use that as the package template. For multiple libraries specified, I think we came to the conclusion to only look at the first one.

I think choosing the default like that makes more sense. It would usually be what people expect, and help pages are rarely looked at, so that an opt-in switch would probably end up being rarely used.

@andre2007
Copy link
Contributor

See pr #1658

@andre2007
Copy link
Contributor

Closing as #1658 is merged.

@andre2007 andre2007 closed this Mar 7, 2019
@s-ludwig s-ludwig mentioned this pull request Mar 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants