You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add support for --template option when creating new project.
The value for `--template` can be anything that you can `npm install`. For example valid calls are:
* `tns create app1 --template tns-template-hello-world`
* `tns create app1 --template https://github.com/NativeScript/template-hello-world-ts/tarball/master`
* `tns create app1 --template ../myTemplate`
In case you use:
`tns create app1 --template typescript` or `tns create app1 --template tsc`, CLI will try to install `tns-template-hello-world-ts` template.
In case you use `tns create app1 --template [email protected]` we will install version 1.2.0 of `tns-template-hello-world-ts`.
When a custom template is used, CLI will extend its App_Resources with the ones from default template in case any of them is missing.
Update npm version in order to support .git urls for --template option.
this.$errors.failWithoutHelp(`Unable to use template ${originalTemplateName}. Make sure you've specified valid name, github URL or path to local dir.`+
this.$errors.failWithoutHelp("Unable to find the template in temp directory. "+
57
+
`Please open an issue at https://github.com/NativeScript/nativescript-cli/issues and send the output of the same command executed with --log trace.`);
58
+
}).future<string>()();
59
+
}
60
+
61
+
/**
62
+
* Install verified NativeScript template in the npm cache.
63
+
* The "special" here is that npmInstallationManager will check current CLI version and will instal best matching version of the template.
64
+
* For example in case CLI is version 10.12.8, npmInstallationManager will try to find latest 10.12.x version of the template.
65
+
* @param {string} templateName The name of the verified NativeScript template.
66
+
* @param {string} version The version of the template specified by user.
67
+
* @return {string} Path to the directory where the template is installed.
0 commit comments