From bc56f2806802e2240ccfb37e3c28987cdb38f305 Mon Sep 17 00:00:00 2001 From: Miles Maddox Date: Mon, 13 Nov 2017 13:48:28 -0600 Subject: [PATCH] take paths as string. a restrictions from terraform --- README.md | 14 ++++++++++++++ index.coffee | 2 ++ package.json | 2 +- 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 78d83ac..84a15a2 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,20 @@ > echo '{"path":"/dev/grafana"}' | get-ssm-params {"ApplicationParameters":"[]"} +``` +or + +``` +> echo '{"paths":["/dev/default","/dev/grafana"]}' | get-ssm-params +{"ApplicationParameters":"[]"} + +``` +or + +``` +> echo '{"paths":"/dev/default /dev/grafana"}' | get-ssm-params +{"ApplicationParameters":"[]"} + ``` ## Development diff --git a/index.coffee b/index.coffee index 113a1cc..03bc052 100644 --- a/index.coffee +++ b/index.coffee @@ -27,6 +27,8 @@ process.stdin.on 'end', -> returnApplicationParameters [res] if parsedData.paths? + if typeof parsedData.paths == 'string' + parsedData.paths = parsedData.paths.split(' ') async.mapSeries parsedData.paths, ((path, cb) -> getAllParameters path, null, null, cb ), (err, res) -> diff --git a/package.json b/package.json index 753825c..1b2bb47 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "get-ssm-params", - "version": "0.0.3", + "version": "0.0.4", "description": "", "main": "index.coffee", "bin": "build/index.js",