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

Add publisher command #397

Merged
merged 3 commits into from Nov 29, 2017
Merged

Conversation

deepueg
Copy link
Contributor

@deepueg deepueg commented Nov 29, 2017

No description provided.

@deepueg deepueg force-pushed the add-publisher-command branch 2 times, most recently from 971427c to b462bae Compare November 29, 2017 00:51
Copy link
Member

@belemaire belemaire left a comment

Choose a reason for hiding this comment

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

All good to me.
Minor review comments inlined. Also make the change to use nap descriptor as discussed in person and I will merge.

#### Syntax

###### Maven publisher
`ern caundron add publisher --mavenUrl=<url>`
Copy link
Member

Choose a reason for hiding this comment

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

typo > caundron

`ern caundron add publisher --mavenUrl=<url>`

###### Github publisher
`ern caundron add publisher --githubUrl=<url>`
Copy link
Member

Choose a reason for hiding this comment

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

typo > caundron

} else if (githubUrl) {
url = githubUrl
} else {
throw new Error(`Please provide a publisher option (publisher --mavenUrl or --gitHubUrl)`)
Copy link
Member

Choose a reason for hiding this comment

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

Single quotes ;) ^^


import inquirer from 'inquirer'

export async function askUserToChooseAnOption (choices: Array<string>, message?: string): Promise<any> {
Copy link
Member

Choose a reason for hiding this comment

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

I like that. We have quite some calls to inquirer directly, it would be leaner to just reuse this one (and maybe other functions that will be addded to this util) where appropriate (through another "prompts" refactoring PR later on).
Makes it also more simple to replace inquirer lib with another one as every use of it will be centralized (also ease mocking for testing) 👍

@@ -0,0 +1,28 @@
## `ern cauldron add publihser`
Copy link
Contributor

Choose a reason for hiding this comment

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

typo publisher


#### Remarks

* The `ern cauldron add publihser` command is mostly used once during the initial setup of cauldron since these links does not change frequently.
Copy link
Contributor

Choose a reason for hiding this comment

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

typo publisher

})
}

exports.handler = async function ({
Copy link
Contributor

Choose a reason for hiding this comment

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

formatting.


log.debug(`Adding ${mavenUrl ? 'maven' : 'gitHub'}publisher: ${url}`)

if (!platform || (platform !== 'ios' && platform !== 'android')) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Typically ios is written as iOS , comparing platform.toLowerCase() could be a consideration? that would leave the users options to remain case agnostic , so for android.

@deepueg
Copy link
Contributor Author

deepueg commented Nov 29, 2017

@belemaire @krunalsshah Thanks for the review. PR updated with requested changes.

@belemaire belemaire merged commit 31ea6b0 into electrode-io:master Nov 29, 2017
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.

None yet

3 participants