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

[WIP] use relative path for template, to avoid git failure #208

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

brodycj
Copy link

@brodycj brodycj commented Jun 24, 2020

Platforms affected

all

Motivation and Context

issue #207

Description

use relative path for template to avoid the git failure reported in issue #207

I suspect that the git failure is due to a change in the way that Cordova CLI works together with npm.

Testing

  • verify that a command like the following succeeds: ./cordova-mobile-spec/createmobilespec/createmobilespec.js --android --debug
  • verify that the generated test app runs on a mobile platform such as Android

Checklist

  • I've run the tests to see all new and existing tests pass
  • I added automated test coverage as appropriate for this change
  • Commit is prefixed with (platform) if this change only applies to one platform (e.g. (android))
  • If this Pull Request resolves an issue, I linked to the issue in the text above (and used the correct keyword to close issues using keywords)
  • I've updated the documentation if necessary

@brodycj brodycj requested review from raphinesse and erisu June 24, 2020 17:36
@@ -420,7 +420,7 @@ if (argv.plugman) {
// Create the project using "cordova create"
myDelete(cli_project_dir);
console.log("### Creating project mobilespec...");
executeShellCommand(cli + " create " + projectDirName + " org.apache.cordova.mobilespec MobileSpec_Tests --template cordova-mobile-spec" + path.sep + "www");
executeShellCommand(cli + " create " + projectDirName + " org.apache.cordova.mobilespec MobileSpec_Tests --template ./cordova-mobile-spec" + path.sep + "www");
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
executeShellCommand(cli + " create " + projectDirName + " org.apache.cordova.mobilespec MobileSpec_Tests --template ./cordova-mobile-spec" + path.sep + "www");
executeShellCommand(cli + " create " + projectDirName + " org.apache.cordova.mobilespec MobileSpec_Tests --template ." + path.sep + "cordova-mobile-spec" + path.sep + "www");

@@ -420,7 +420,7 @@ if (argv.plugman) {
// Create the project using "cordova create"
myDelete(cli_project_dir);
console.log("### Creating project mobilespec...");
executeShellCommand(cli + " create " + projectDirName + " org.apache.cordova.mobilespec MobileSpec_Tests --template cordova-mobile-spec" + path.sep + "www");
executeShellCommand(cli + " create " + projectDirName + " org.apache.cordova.mobilespec MobileSpec_Tests --template ./cordova-mobile-spec" + path.sep + "www");
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or better yet:

Suggested change
executeShellCommand(cli + " create " + projectDirName + " org.apache.cordova.mobilespec MobileSpec_Tests --template ./cordova-mobile-spec" + path.sep + "www");
executeShellCommand(cli + ` create ${projectDirName} org.apache.cordova.mobilespec MobileSpec_Tests --template ${path.join('.', 'cordova-mobile-spec', 'www')}`);

(not yet tested, should be considered a major change)

@brodycj brodycj mentioned this pull request Jun 24, 2020
5 tasks
@@ -420,7 +420,7 @@ if (argv.plugman) {
// Create the project using "cordova create"
myDelete(cli_project_dir);
console.log("### Creating project mobilespec...");
executeShellCommand(cli + " create " + projectDirName + " org.apache.cordova.mobilespec MobileSpec_Tests --template cordova-mobile-spec" + path.sep + "www");
executeShellCommand(cli + " create " + projectDirName + " org.apache.cordova.mobilespec MobileSpec_Tests --template ./cordova-mobile-spec" + path.sep + "www");
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does not work - ./cordova-mobile-spec/createmobilespec/createmobilespec.js --android ends with the following non-descriptive output:

### Creating project mobilespec...
$ /Users/brodybits/dev/cordova-test/cordova/cordova-cli/bin/cordova create mobilespec org.apache.cordova.mobilespec MobileSpec_Tests --template ./cordova-mobile-spec/www
Warning: using prerelease version 10.0.0-dev ([email protected])
Creating a new cordova project.
/Users/brodybits/dev/cordova-test/cordova/cordova-mobile-spec/www is not a valid template

Unfortunately I did not see the error message before I raised this PR.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This error message is from cordova-create. With the latest bunch of breaking changes there, we removed support for plain www dirs as templates. I did not take a closer look at the code here, but a simple fix could be creating a project with the default template and replacing the www dir afterwards.

@brodycj brodycj changed the title use relative path for template, to avoid git failure [WIP] use relative path for template, to avoid git failure Jun 24, 2020
@brodycj brodycj removed request for raphinesse and erisu June 24, 2020 18:26
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

Successfully merging this pull request may close these issues.

2 participants