csantanapr opened a new issue #126: Support reading param.json from stdin
URL: https://github.com/apache/incubator-openwhisk-cli/issues/126
 
 
   @alexkli commented on [Thu Oct 05 
2017](https://github.com/apache/incubator-openwhisk/issues/2837)
   
   It would be useful to support reading a parameter json file from stdin for 
various piping scenarios, using the convention of "-" as filename:
   
       cat some.json | envsubst | wsk action invoke my-action -P -
   
   In this example we can leverage `envsubst` to replace some environment 
variables in the file. Without being able to read from stdin, one has to push 
the content into a temporary file, invoke and then delete the temp file again.
   
   From looking at the go cli code, it seems `readFile()` in 
[util.go](https://github.com/apache/incubator-openwhisk/blob/26146368f1dd07f817062e662db64c73a8d486d6/tools/cli/go-whisk-cli/commands/util.go#L829)
 could be adapted to leverage `ioutil.ReadAll(os.Stdin)` in case `filename == 
"-"`. One probably has to check if that is ok for all other `readFile()` 
usages, or if that should be a special option reserved for `-P --param-file` 
only.
   
   ---
   
   @alexkli commented on [Tue Oct 10 
2017](https://github.com/apache/incubator-openwhisk/issues/2837#issuecomment-335628635)
   
   Provided pull request #2848.
   
   Please have a look, thanks!
   
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to