Cannot fetch plugin from git subdirectory

  • 1
  • Problem
  • Updated 4 years ago
I am having trouble to add plugins from a git subdiretory.

I add any of the following combinations to my config.xml but none seems to work:


<plugin spec="https://github.com/apache/cordova-plugin-battery-status/tests" source="git"/>

or

<plugin spec="https://github.com/apache/cordova-plugin-battery-status/master/tests" source="git"/>

or

<plugin spec="https://github.com/apache/cordova-plugin-battery-status/tree/master/tests" source="git"/>


I always get this error


"plugman install --platform android --project /project --plugin https://github.com/apache/cordova-plugin-battery-status/tests": Fetching plugin "https://github.com/apache/cordova-plugin-battery-status/tests" via git clone
Failed to fetch plugin https://github.com/apache/cordova-plugin-battery-status/tests via git.
Either there is a connection problems, or plugin spec is incorrect:
Error: git: Command failed with exit code 128 Error output:
Cloning into '/tmp/git/1463164675772'...
fatal: repository 'https://github.com/apache/cordova-plugin-battery-status/tests/' not found


Help will be appreciated.

Thanks
Photo of Jeremías Gersicich

Jeremías Gersicich

  • 4 Posts
  • 0 Reply Likes

Posted 4 years ago

  • 1
Photo of JesseMonroy650 (Volunteer)

JesseMonroy650 (Volunteer), Champion

  • 3325 Posts
  • 122 Reply Likes
@Jeremías,
Since this is your first post, please answer the following question:
- is this your first hybrid app?
- are you using Desktop App?
- are you using CLI, Build, or SDK? Please do not assume the answer, please read the link.

Thanks
Jesse
Photo of Jeremías Gersicich

Jeremías Gersicich

  • 4 Posts
  • 0 Reply Likes
Is kind of my first app, I am a tester more than a developer and I have to build a project already developed using Phonegap Build.

So the answers are:
No
No
Build
Photo of JesseMonroy650 (Volunteer)

JesseMonroy650 (Volunteer), Champion

  • 3325 Posts
  • 122 Reply Likes
@Jeremías,
Okay. I see some confusion, but i also see a capable developer.
However, before we get to resolving this issue, I must ask why
you are trying to pull a "core" plugin from github. They standard procedure
is to pull from the default or npm. Can you help me understand what
your final goal is, and not just this intermediate step?

TIA
Jesse
Photo of Jeremías Gersicich

Jeremías Gersicich

  • 4 Posts
  • 0 Reply Likes
It is not a core plugin. I have already fetch the core plugin from the npm. This is a plugin (and there is kne for each core plugin) that allows performing automated test of that core plugin
Photo of JesseMonroy650 (Volunteer)

JesseMonroy650 (Volunteer), Champion

  • 3325 Posts
  • 122 Reply Likes
@Jeremías,
Okay. I think i got. You are have problems with a feature of the plugin. As such, you need to ask the author of the plugin. Unfortunately, at this time, "automated test(ing)" is not part of the standard workflow for PGB. We could bring this to the attention of the PGB team, but it is unlikely to get much time from them.

Have you asked the author about this? Perhaps the author is assuming the test framework is being used only by CLI developers?

Specifically on your issue, the last line says "fatal: repository 'https:(...)' not found". This indicates to me that the URL is incorrect _or_ that you might have insufficient instructions on how to add this test strap. Can you check your URL? Or point to the instructions on this test strap? I could look over the instructions.

Jesse
Photo of Jeremías Gersicich

Jeremías Gersicich

  • 4 Posts
  • 0 Reply Likes
Thanks for your reply. I don't think this is a plugin problem since I was able to fetch them using CLI with cmd.

I think that PGB can not fetch a plugin that is located on a subdirectory.

What do you think about that?
Photo of JesseMonroy650 (Volunteer)

JesseMonroy650 (Volunteer), Champion

  • 3325 Posts
  • 122 Reply Likes
@Jeremias

Thanks for your reply. I don't think this is a plugin problem since I was able to fetch them using CLI with cmd.

I think that PGB can not fetch a plugin that is located on a subdirectory.

What do you think about that?

Yes, that is exactly what I am saying. The author of the plugin assumes that CLI will be used - as such it is not working with PGB.

To be clear PGB, can use github and other repositories, but it assumes certain things. Those "assumptions" are different from the author of the plugin. If you ask the author of the plugin, this might be resolved and added to PGB. But if you don't ask, we will never know.

For instance, "pre-hook", procedure for plugin developers, is not supported. This might be your issue, but again, you need to ask the author.

Jesse