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

cordova platform add refactor #105

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

Conversation

dpogue
Copy link
Member

@dpogue dpogue commented Jul 24, 2018

Proposal for splitting the behaviour of cordova platform add into several smaller steps that could be reused by other parts of the tooling and more easily tested.

See also: apache/cordova-common#34 for a first pass at some of the lower-level package.json support needed for this.

/fyi @raphinesse @erisu @brodybits

Copy link

@raphinesse raphinesse left a comment

Choose a reason for hiding this comment

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

At first glance, this seems like a good plan to me. 👍

let pkgJson = new PackageHelper('package.json')

// TODO: See if there's an easy way to determine if the platform is already
// installed with a matching version and avoid the npm invocation

Choose a reason for hiding this comment

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

cordova-fetch already does this, so you can just call it and use the path to the installed package it returns to determine the package name too.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah nice!

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