[
https://issues.apache.org/jira/browse/CB-12807?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16290152#comment-16290152
]
ASF GitHub Bot commented on CB-12807:
-------------------------------------
stevengill closed pull request #9: CB-12807 : updated error message to follow
the template guide
URL: https://github.com/apache/cordova-create/pull/9
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git a/index.js b/index.js
index 827f158..cd1c2a6 100644
--- a/index.js
+++ b/index.js
@@ -210,7 +210,10 @@ module.exports = function(dir, optionalId, optionalName,
cfg, extEvents) {
events.emit('verbose', 'Using cordova-fetch for '+ target);
return fetch(target, tempDest, {})
.fail(function(err){
- events.emit('error', '\033[1m \033[31m Error from Cordova
Fetch: ' + err.message);
+ events.emit('verbose', '\033[1m \033[31m Error from Cordova
Fetch: ' + err.message);
+ events.emit('error', 'The template you are trying to use is
invalid.' +
+ ' Make sure you follow the template guide found here
https://cordova.apache.org/docs/en/latest/guide/cli/template.html.' +
+ ' Templates now require a package.json.');
if (options.verbose) {
console.trace();
}
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
> Improve error message for bad templates when using cordova create --template
> ----------------------------------------------------------------------------
>
> Key: CB-12807
> URL: https://issues.apache.org/jira/browse/CB-12807
> Project: Apache Cordova
> Issue Type: Improvement
> Components: cordova-create
> Affects Versions: 1.1.1
> Reporter: Steve Gill
> Assignee: Audrey So
> Labels: cordova-8.0.0, triaged
>
> right now, we don't handle the error very well when you are using a invalid
> template during cordova create --template sometemplate. We just spew out the
> npm stack. It would be better if we could catch the error and provide a nicer
> message to our users. Something along the lines of the template is invalid.
> Make sure you follow the template guide when creating a template. (link to
> template guide). Templates now require a package.json.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]