amplify-frontend-android
Advanced tools
Comparing version 0.1.34-multienv.0 to 0.1.34
@@ -6,4 +6,4 @@ # Change Log | ||
<a name="0.1.34-multienv.0"></a> | ||
## [0.1.34-multienv.0](https://github.com/aws-amplify/amplify-cli/compare/amplify-frontend-android@0.1.33...amplify-frontend-android@0.1.34-multienv.0) (2018-11-16) | ||
<a name="0.1.34"></a> | ||
## [0.1.34](https://github.com/aws-amplify/amplify-cli/compare/amplify-frontend-android@0.1.33...amplify-frontend-android@0.1.34) (2018-12-18) | ||
@@ -13,3 +13,3 @@ | ||
* headless Init and configure ([#371](https://github.com/aws-amplify/amplify-cli/issues/371)) ([acd14a8](https://github.com/aws-amplify/amplify-cli/commit/acd14a8)) | ||
* **amplify-category-notifications:** merge notifications changes ([#577](https://github.com/aws-amplify/amplify-cli/issues/577)) ([b9d2f4d](https://github.com/aws-amplify/amplify-cli/commit/b9d2f4d)) | ||
@@ -16,0 +16,0 @@ |
const inquirer = require('inquirer'); | ||
const constants = require('./constants'); | ||
async function init(context) { | ||
normalizeInputParams(context); | ||
await confirmConfiguration(context); | ||
return context; | ||
function init(context) { | ||
context.print.info('Describe your project:'); | ||
return promptForConfiguration(context); | ||
} | ||
function onInitSuccessful(context) { | ||
return context; | ||
return new Promise((resolve) => { | ||
resolve(context); | ||
}); | ||
} | ||
async function configure(context) { | ||
normalizeInputParams(context); | ||
await confirmConfiguration(context); | ||
return context; | ||
function configure(context) { | ||
return promptForConfiguration(context); | ||
} | ||
function normalizeInputParams(context) { | ||
let inputParams; | ||
if (context.exeInfo.inputParams && context.exeInfo.inputParams[constants.Label]) { | ||
inputParams = context.exeInfo.inputParams[constants.Label]; | ||
} | ||
if (inputParams && inputParams.config) { | ||
if (!inputParams.config.ResDir) { | ||
throw new Error('The command line parameter for android frontend configuration is incomplete.'); | ||
} | ||
} | ||
context.exeInfo.inputParams[constants.Label] = inputParams; | ||
} | ||
async function confirmConfiguration(context) { | ||
function promptForConfiguration(context) { | ||
if (!context.exeInfo.projectConfig[constants.Label]) { | ||
@@ -40,21 +26,17 @@ context.exeInfo.projectConfig[constants.Label] = {}; | ||
} | ||
const { config } = context.exeInfo.projectConfig[constants.Label]; | ||
const configurationSettings = [ | ||
{ | ||
type: 'input', | ||
name: 'ResDir', | ||
message: 'Where is your Res directory: ', | ||
default: config.ResDir || 'app/src/main/res', | ||
}, | ||
]; | ||
const inputParams = context.exeInfo.inputParams[constants.Label]; | ||
if (inputParams) { | ||
Object.assign(context.exeInfo.projectConfig[constants.Label], inputParams); | ||
} else if (!context.exeInfo.inputParams.yes) { | ||
context.print.info('Please tell us about your project'); | ||
const { config } = context.exeInfo.projectConfig[constants.Label]; | ||
const configurationSettings = [ | ||
{ | ||
type: 'input', | ||
name: 'ResDir', | ||
message: 'Where is your Res directory: ', | ||
default: config.ResDir || 'app/src/main/res', | ||
}, | ||
]; | ||
const answers = await inquirer.prompt(configurationSettings); | ||
config.ResDir = answers.ResDir; | ||
} | ||
return inquirer.prompt(configurationSettings) | ||
.then((answers) => { | ||
config.ResDir = answers.ResDir; | ||
return context; | ||
}); | ||
} | ||
@@ -61,0 +43,0 @@ |
module.exports = { | ||
Label: 'android', | ||
Label: 'amplify-frontend-android', | ||
ProjectScanBaseScore: 0, | ||
@@ -4,0 +4,0 @@ ProjectScanMaxScore: 100, |
@@ -8,3 +8,3 @@ const constants = require('./constants'); | ||
const projectPath = context.exeInfo ? | ||
context.exeInfo.localEnvInfo.projectPath : amplify.getEnvInfo().projectPath; | ||
context.exeInfo.projectConfig.projectPath : amplify.getProjectConfig().projectPath; | ||
const projectConfig = context.exeInfo ? | ||
@@ -60,3 +60,3 @@ context.exeInfo.projectConfig[constants.Label] : amplify.getProjectConfig()[constants.Label]; | ||
const projectPath = context.exeInfo ? | ||
context.exeInfo.localEnvInfo.projectPath : amplify.getEnvInfo().projectPath; | ||
context.exeInfo.projectConfig.projectPath : amplify.getProjectConfig().projectPath; | ||
const projectConfig = context.exeInfo ? | ||
@@ -143,3 +143,3 @@ context.exeInfo.projectConfig[constants.Label] : amplify.getProjectConfig()[constants.Label]; | ||
AppId: pinpointResource.output.Id, | ||
Region: 'us-east-1', | ||
Region: pinpointResource.output.Region, | ||
}, | ||
@@ -149,3 +149,3 @@ }, | ||
Default: { | ||
Region: 'us-east-1', | ||
Region: pinpointResource.output.Region, | ||
}, | ||
@@ -152,0 +152,0 @@ }, |
{ | ||
"name": "amplify-frontend-android", | ||
"version": "0.1.34-multienv.0", | ||
"version": "0.1.34", | ||
"description": "amplify-cli front-end plugin for Android project", | ||
@@ -11,3 +11,3 @@ "main": "index.js", | ||
"eslint": "^4.19.1", | ||
"fs-extra": "^7.0.0", | ||
"fs-extra": "^6.0.1", | ||
"inquirer": "^6.0.0", | ||
@@ -14,0 +14,0 @@ "path": "^0.12.7" |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
15555
299
+ Addedfs-extra@6.0.1(transitive)
- Removedfs-extra@7.0.1(transitive)
Updatedfs-extra@^6.0.1