apache / cordova-mobile-spec

Apache Cordova mobile-spec
Apache License 2.0
66 stars 107 forks source link

createmobilespec.js fails with a git error #207

Open brodycj opened 4 years ago

brodycj commented 4 years ago

Bug Report

Problem

What is expected to happen?

A command like this from the documentation should just work after following the prerequisites:

node ./cordova-mobile-spec/createmobilespec/createmobilespec.js --android

What does actually happen?

failed with a git error, like this:

brodybits@brodybits-mini-macbook cordova-testing % ./cordova-mobile-spec/createmobilespec/createmobilespec.js --android           
### Creating project from local git repos. If you have any errors, it may be from missing repositories.
To clone repositories:
  ./cordova-coho/coho repo-clone -r mobile-spec -r plugin-test-framework -r cli -r lib -r plugman -r android -r js -r plugins
  mkdir cordova-cli/node_modules
  (cd cordova-lib && npm install)
  (cd cordova-plugman/ && npm install)
  mkdir cordova-cli/node_modules
  ln -s ../../cordova-lib cordova-cli/node_modules
  (cd cordova-cli && npm install)
To update all repositories:
  ./cordova-coho/coho repo-update
Checking if you are using master branch of tools (js, lib, plugman, cli)
$ git symbolic-ref HEAD
refs/heads/master
$ git symbolic-ref HEAD
refs/heads/master
$ git symbolic-ref HEAD
refs/heads/master
$ git symbolic-ref HEAD
refs/heads/master
You are on master branch of tools, checking npm links
npm links are OK
### Creating project mobilespec...
$ /Users/brodybits/dev/cordova-testing/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 (cordova-lib@10.0.0-dev)
Creating a new cordova project.
Error: npm: Command failed with exit code 1 Error output:
npm ERR! Error while executing:
npm ERR! /usr/bin/git ls-remote -h -t ssh://git@github.com/cordova-mobile-spec/www.git
npm ERR! 
npm ERR! ERROR: Repository not found.
npm ERR! fatal: Could not read from remote repository.
npm ERR! 
npm ERR! Please make sure you have the correct access rights
npm ERR! and the repository exists.
npm ERR! 
npm ERR! exited with error code: 128

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/brodybits/.npm/_logs/2020-06-24T17_16_23_896Z-debug.log
    at ChildProcess.whenDone (/Users/brodybits/dev/cordova-testing/cordova-common/src/superspawn.js:136:25)
    at ChildProcess.emit (events.js:315:20)
    at maybeClose (internal/child_process.js:1021:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5) {
  stderr: 'npm ERR! Error while executing:\n' +
    'npm ERR! /usr/bin/git ls-remote -h -t ssh://git@github.com/cordova-mobile-spec/www.git\n' +
    'npm ERR! \n' +
    'npm ERR! ERROR: Repository not found.\n' +
    'npm ERR! fatal: Could not read from remote repository.\n' +
    'npm ERR! \n' +
    'npm ERR! Please make sure you have the correct access rights\n' +
    'npm ERR! and the repository exists.\n' +
    'npm ERR! \n' +
    'npm ERR! exited with error code: 128\n' +
    '\n' +
    'npm ERR! A complete log of this run can be found in:\n' +
    'npm ERR!     /Users/brodybits/.npm/_logs/2020-06-24T17_16_23_896Z-debug.log\n',
  code: 1
}

possible fix

The following change seemed to resolve this issue:

diff --git a/createmobilespec/createmobilespec.js b/createmobilespec/createmobilespec.js
index 1e0bf85..21cf96b 100755
--- a/createmobilespec/createmobilespec.js
+++ b/createmobilespec/createmobilespec.js
@@ -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");
     shelljs.cp("-f", path.join(mobile_spec_git_dir, 'config.xml'), path.join(projectDirName, 'config.xml'));

     // Config.json file ---> linked to local libraries

Information

see above

Command or Code

see above

Environment, Platform, Device

see above & below

Version information

host: macOS Catalina

Checklist