From 939acb54d2acf070653f55bf871157b269158674 Mon Sep 17 00:00:00 2001 From: "John F. Mercer" Date: Mon, 24 Aug 2015 13:45:26 -0400 Subject: [PATCH 1/4] Saves AWS keys for amend Q/A --- lib/questions.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/questions.js b/lib/questions.js index 70def37..cdbdc3e 100644 --- a/lib/questions.js +++ b/lib/questions.js @@ -26,6 +26,7 @@ type: 'input', name: 'appName', message: function() { + // This clears the screen process.stdout.write('\u001b[2J\u001b[0;0H'); return 'What is the name of your application?'; }, @@ -314,6 +315,7 @@ type: 'input', name: 'aws_key', message: 'What is your AWS Access Key?', + default: 'awsAccessKey', validate: function(value) { var regex = regexes.awsKey; @@ -325,6 +327,7 @@ type: 'input', name: 'aws_secret_key', message: 'What is your AWS Secret Access Key?', + default: 'awsSecretKey', validate: function(value) { var regex = regexes.awsSecret; // This regex is essentially the same as the above, but it looks for 40 character, From 7388eaa04203d1469d68568bddd6f2aed5a5815e Mon Sep 17 00:00:00 2001 From: "John F. Mercer" Date: Mon, 24 Aug 2015 14:07:36 -0400 Subject: [PATCH 2/4] Updates changelog & npm version number --- CHANGELOG.md | 5 +++++ package.json | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bacf2f4..ca9a815 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,11 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/). +## 0.1.4 - 2015-08-24 +* Fix + * The emendation dialogue now offers the AWS keys entered + during the first Q&A as the default values. + ## 0.1.3 - 2015-08-20 * Additions * A `CHANGELOG` diff --git a/package.json b/package.json index bd3795b..5df7b9d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "radiian", - "version": "0.1.3", + "version": "0.1.4", "description": "Radiian generates an Ansible playbook for immutable infrastructure with AWS.", "bin": "lib/radiian.js", "main": "lib/radiian.js", From 7adcba98a6f892485c0026d4c2eb4daa002a931e Mon Sep 17 00:00:00 2001 From: "John F. Mercer" Date: Mon, 24 Aug 2015 14:45:30 -0400 Subject: [PATCH 3/4] Adds devDependency badge to repo --- CHANGELOG.md | 3 ++- README.md | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ca9a815..beffc21 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,9 +3,10 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/). ## 0.1.4 - 2015-08-24 +* Adds devDependency badge to README * Fix * The emendation dialogue now offers the AWS keys entered - during the first Q&A as the default values. + during the first Q&A as the default values ## 0.1.3 - 2015-08-20 * Additions diff --git a/README.md b/README.md index e3d0a45..6de4c9a 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ [![Travis Build Status](https://travis-ci.org/radify/radiian.svg)](https://travis-ci.org/radify/radiian?branch=master) [![npm version](https://badge.fury.io/js/radiian.svg)](http://npmjs.com/package/radiian) [![Dependency Status](https://david-dm.org/radify/radiian.svg)](https://david-dm.org/radify/radiian) +[![devDependency Status](https://david-dm.org/radify/radiian/dev-status.svg)](https://david-dm.org/radify/radiian#info=devDependencies) # Radiian From 0107868f183bf8dc0e7a76590e319c665377eb6b Mon Sep 17 00:00:00 2001 From: Gavin Davies Date: Mon, 24 Aug 2015 20:15:45 +0100 Subject: [PATCH 4/4] Modify the way defaults are updated * When completing Radiian, copy across all current answers as defaults in all instances. * Do not set a default for the AWS secret key, but do show the AWS examples so the user can see what these values should resemble. * More functional way of looping through questions rather than a for loop. --- lib/questions.js | 6 ++---- lib/radiian-init.js | 8 +++----- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/lib/questions.js b/lib/questions.js index cdbdc3e..5fa0937 100644 --- a/lib/questions.js +++ b/lib/questions.js @@ -314,8 +314,7 @@ }, { type: 'input', name: 'aws_key', - message: 'What is your AWS Access Key?', - default: 'awsAccessKey', + message: 'What is your AWS Access Key (e.g. AKIAIOSFODNN7EXAMPLE)?', validate: function(value) { var regex = regexes.awsKey; @@ -326,8 +325,7 @@ }, { type: 'input', name: 'aws_secret_key', - message: 'What is your AWS Secret Access Key?', - default: 'awsSecretKey', + message: 'What is your AWS Secret Access Key (e.g. wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY)?', validate: function(value) { var regex = regexes.awsSecret; // This regex is essentially the same as the above, but it looks for 40 character, diff --git a/lib/radiian-init.js b/lib/radiian-init.js index 967f054..b6c4049 100755 --- a/lib/radiian-init.js +++ b/lib/radiian-init.js @@ -29,11 +29,9 @@ if (!confirmation.confirm) { // load existing answers as defaults into questions so user is modifying, // not starting from scratch - for (var i = 0; i < questions.length; i++) { - if (questions[i].default) { - questions[i].default = answers[questions[i].name]; - } - } + questions.map(function(question) { + question.default = answers[question.name]; + }); go(questions); } else { submittedAnswers = answers;