Skip to content

Commit

Permalink
[#8] Prompt for Android keystore properties bug
Browse files Browse the repository at this point in the history
Fix #8
  • Loading branch information
miguelrrc committed Jun 12, 2019
1 parent 6b032d6 commit e29a75c
Showing 1 changed file with 29 additions and 10 deletions.
39 changes: 29 additions & 10 deletions src/flows/android.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,31 +4,50 @@ module.exports.runAndroid = async (toolbox, config) => {
await setupGradle(toolbox, config)
}

const askQuestion = async (prompt, options) => {
const askQuestions = async (prompt, options) => {
const askGooglePlayJSONPath = {
type: 'input',
initial: options.googleJsonPath,
skip: () => options.googleJsonPath,
name: 'googleJsonPath',
message: 'Path to Google Play Store JSON?'
}
const { googleJsonPath } = await prompt.ask(askGooglePlayJSONPath)
return {
googleJsonPath: options.googleJsonPath,
googleJsonPath
const askStorePassword = {
type: 'input',
initial: options.storePassword,
skip: () => options.storePassword,
name: 'storePassword',
message: 'Keystore password?'
}
const askAliasPassword = {
type: 'input',
initial: options.aliasPassword,
skip: () => options.aliasPassword,
name: 'aliasPassword',
message: 'Keystore alias password?'
}
const askAlias = {
type: 'input',
initial: options.alias,
skip: () => options.alias,
name: 'askAlias',
message: 'Keystore alias?'
}

const answers = prompt.ask([askGooglePlayJSONPath, askAlias, askStorePassword, askAliasPassword])
return answers
}

const initAndroid = async ({ android, http, prompt, print, circle }, options) => {

const { githubOrg, repo, circleApi } = options
const { googleJsonPath } = await askQuestion(prompt, options)

const answers = await askQuestions(prompt, options)
const { googleJsonPath, storePassword, aliasPassword, alias } = answers
const keystoreFiles = await android.createKeystore({
name: repo,
storePassword: '123456',
alias: 'circleci',
aliasPassword: '123456'
storePassword: storePassword,
alias: alias,
aliasPassword: aliasPassword
})

print.info('Store keystore to secret variables')
Expand Down

0 comments on commit e29a75c

Please sign in to comment.