apache / apache/cordova-cli

cordova prepare does not call platform prepare hooks

Open
#358 6 comments 1 reaction 0 assignees View on GitHub
bug good first issue
Dominant language
JavaScript
Stars
967
Forks
344
Avg merge
8h 41m
Merged PRs (30d)
9

Description

If a prepare hook is defined in a platform block, it is not executed when `cordova prepare` is called without specifying a platform.

My expectation is that the platform prepare hooks will be still be called when a platform is not provided as an argument to the platform prepare command.

For example:

Given the following hook:

```


...

```

When executing the command:

```
cordova prepare
```

the hook will not be found or executed.

However when executing the command:

```
cordova prepare android
```

the hook will be found and run as expected.

I have observed this for project and plugin hooks.

Is this behaviour by design? My thinking is that it is then always safer to run the platform prepare command with an explicit platform.

Thanks.

```
Collecting Data...

Node version: v8.10.0

Cordova version: 8.0.0
```

Contributor guide

Open the contributing guide

Research direction

Reproduce the difference between `cordova prepare` and `cordova prepare android` using the platform hook example in the issue, checking both project and plugin hooks. Trace the prepare command's platform selection and hook execution paths; done means platform prepare hooks run consistently when no platform argument is supplied, with the existing explicit-platform behavior preserved.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, nodejs
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.